diff options
author | Jeff Layton <jlayton@samba.org> | 2012-11-07 10:19:15 -0500 |
---|---|---|
committer | Jeff Layton <jlayton@samba.org> | 2012-11-07 10:19:15 -0500 |
commit | 1b2b1ab1084b1fbae324c8461a515b6851167e06 (patch) | |
tree | 882a77d18059e5de288b65ffe8aeaffb71ec46c7 | |
parent | 30fabc23eb74ec9de69fb0f0331815970aa9bf12 (diff) | |
download | cifs-utils-1b2b1ab1084b1fbae324c8461a515b6851167e06.tar.gz cifs-utils-1b2b1ab1084b1fbae324c8461a515b6851167e06.tar.bz2 cifs-utils-1b2b1ab1084b1fbae324c8461a515b6851167e06.zip |
get/setcifsacl: set "prog" via basename(argv[0])
This saves a tiny bit of memory, and doesn't make the program assume
that the binary is named something in particular.
Signed-off-by: Jeff Layton <jlayton@samba.org>
-rw-r--r-- | getcifsacl.c | 3 | ||||
-rw-r--r-- | setcifsacl.c | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/getcifsacl.c b/getcifsacl.c index 8cbdb1d..da4bb67 100644 --- a/getcifsacl.c +++ b/getcifsacl.c @@ -38,7 +38,7 @@ #include <sys/xattr.h> #include "cifsacl.h" -static const char *prog = "getcifsacl"; +static const char *prog; static void print_each_ace_mask(uint32_t mask) @@ -333,6 +333,7 @@ main(const int argc, char *const argv[]) size_t bufsize = BUFSIZE; char *filename, *attrval; + prog = basename(argv[0]); openlog(prog, 0, LOG_DAEMON); while ((c = getopt_long(argc, argv, "r:v", NULL, NULL)) != -1) { diff --git a/setcifsacl.c b/setcifsacl.c index 380adac..50822e6 100644 --- a/setcifsacl.c +++ b/setcifsacl.c @@ -39,7 +39,7 @@ #include <sys/xattr.h> #include "cifsacl.h" -static const char *prog = "setcifsacl"; +static const char *prog; static void copy_sec_desc(const struct cifs_ntsd *pntsd, struct cifs_ntsd *pnntsd, @@ -775,6 +775,8 @@ main(const int argc, char *const argv[]) struct cifs_ace **cacesptr = NULL, **facesptr = NULL; struct cifs_ntsd *ntsdptr = NULL; + prog = basename(argv[0]); + openlog(prog, 0, LOG_DAEMON); c = getopt(argc, argv, "v:D:M:a:S:?"); |