From: John Hodge Date: Wed, 5 Oct 2011 04:08:41 +0000 (+0800) Subject: Kernel/proc - Fixed version display X-Git-Tag: rel0.11~28 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=cc9c4465db1c38904798f967019c863f5b552d5f;p=tpg%2Facess2.git Kernel/proc - Fixed version display --- diff --git a/Kernel/drv/proc.c b/Kernel/drv/proc.c index 80561147..75d9e1fe 100644 --- a/Kernel/drv/proc.c +++ b/Kernel/drv/proc.c @@ -10,7 +10,6 @@ // === CONSTANTS === #define VERSION ((0 << 8) | (1)) // 0.01 -#define KERNEL_VERSION_STRING ("Acess2 " EXPAND_STR(KERNEL_VERSION) " build " EXPAND_STR(BUILD_NUM)) // === TYPES === typedef struct sSysFS_Ent @@ -46,9 +45,9 @@ tSysFS_Ent gSysFS_Version_Kernel = { &gSysFS_Version, // Parent { .Inode = 1, // File #1 - .ImplPtr = (void*)KERNEL_VERSION_STRING, + .ImplPtr = NULL, .ImplInt = (Uint)&gSysFS_Version_Kernel, // Self-Link - .Size = sizeof(KERNEL_VERSION_STRING)-1, + .Size = 0, .NumACLs = 1, .ACLs = &gVFS_ACL_EveryoneRO, .Read = SysFS_Comm_ReadFile @@ -104,6 +103,13 @@ tSysFS_Ent *gSysFS_FileList; */ int SysFS_Install(char **Options) { + { + const char *fmt = "Acess2 "EXPAND_STR(KERNEL_VERSION)" build %i, hash %s"; + gSysFS_Version_Kernel.Node.Size = sprintf(NULL, fmt, BUILD_NUM, gsGitHash); + gSysFS_Version_Kernel.Node.ImplPtr = malloc( gSysFS_Version_Kernel.Node.Size + 1 ); + sprintf(gSysFS_Version_Kernel.Node.ImplPtr, fmt, BUILD_NUM, gsGitHash); + } + DevFS_AddDevice( &gSysFS_DriverInfo ); return MODULE_ERR_OK; }