Displaying 2 results from an estimated 2 matches for "8b620fd".
2014 Apr 15
0
[klibc:master] readlink: Handle multiple input arguments
...ments
Handle 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,...
2014 Apr 15
0
[klibc:master] readlink: Better buffer handling
...printf()
Reported-by: Rafi Rubin <rafi at seas.upenn.edu>
Signed-off-by: H. Peter Anvin <hpa at linux.intel.com>
---
usr/utils/readlink.c | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/usr/utils/readlink.c b/usr/utils/readlink.c
index 5ea4e41..8b620fd 100644
--- a/usr/utils/readlink.c
+++ b/usr/utils/readlink.c
@@ -13,8 +13,9 @@ static __noreturn usage(void)
int main(int argc, char *argv[])
{
- char *name, *link_name = NULL;
- size_t max_siz = 128;
+ const char *name;
+ char link_name[PATH_MAX];
+ int rv;
progname = *argv++;
@@ -22,15...