search for: bf9501b

Displaying 2 results from an estimated 2 matches for "bf9501b".

Did you mean: 5f9551b
2014 Apr 15
0
[klibc:master] readlink: Handle multiple input arguments
...ndle multiple links as parguments passed to readlink(). Signed-off-by: H. Peter Anvin <hpa at linux.intel.com> --- usr/utils/readlink.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/usr/utils/readlink.c b/usr/utils/readlink.c index 8b620fd..bf9501b 100644 --- a/usr/utils/readlink.c +++ b/usr/utils/readlink.c @@ -3,11 +3,11 @@ #include <unistd.h> #include <sys/stat.h> -char *progname; +const char *progname; static __noreturn usage(void) { - fprintf(stderr, "Usage: %s link\n", progname); + fprintf(stderr, "Usa...
2014 Apr 15
0
[klibc:master] readlink: Reduce size by calling _fwrite() instead of puts()
...as well call _fwrite() directly, with the explicit termination set to \n instead of \0. Signed-off-by: H. Peter Anvin <hpa at linux.intel.com> --- usr/utils/readlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr/utils/readlink.c b/usr/utils/readlink.c index bf9501b..4e3cfcb 100644 --- a/usr/utils/readlink.c +++ b/usr/utils/readlink.c @@ -29,8 +29,8 @@ int main(int argc, char *argv[]) perror(name); exit(1); } - link_name[rv] = '\0'; - puts(link_name); + link_name[rv] = '\n'; + _fwrite(link_name, rv+1, stdout); } return 0;