diff --git a/fs/procfs/Make.defs b/fs/procfs/Make.defs index 99ca2df91f..56607afce0 100644 --- a/fs/procfs/Make.defs +++ b/fs/procfs/Make.defs @@ -49,9 +49,4 @@ endif DEPPATH += --dep-path procfs VPATH += :procfs -# To ensure version information is newest, -# add fs_procfsversion to phony target for force rebuild - -.PHONY: fs_procfsversion$(OBJEXT) - endif diff --git a/fs/procfs/fs_procfsversion.c b/fs/procfs/fs_procfsversion.c index fc2c55ce69..1a3e0c1d19 100644 --- a/fs/procfs/fs_procfsversion.c +++ b/fs/procfs/fs_procfsversion.c @@ -41,6 +41,7 @@ #include #include +#include #include #include @@ -206,6 +207,7 @@ static ssize_t version_read(FAR struct file *filep, FAR char *buffer, size_t buflen) { FAR struct version_file_s *attr; + struct utsname name; size_t linesize; off_t offset; ssize_t ret; @@ -219,16 +221,9 @@ static ssize_t version_read(FAR struct file *filep, FAR char *buffer, if (filep->f_pos == 0) { -#if defined(__DATE__) && defined(__TIME__) - linesize = snprintf(attr->line, VERSION_LINELEN, - "NuttX version %s %s %s %s\n", - CONFIG_VERSION_STRING, CONFIG_VERSION_BUILD, - __DATE__, __TIME__); -#else - linesize = snprintf(attr->line, VERSION_LINELEN, - "NuttX version %s %s\n", - CONFIG_VERSION_STRING, CONFIG_VERSION_BUILD); -#endif + uname(&name); + linesize = snprintf(attr->line, VERSION_LINELEN, "%s version %s %s\n", + name.sysname, name.release, name.version); /* Save the linesize in case we are re-entered with f_pos > 0 */