aboutsummaryrefslogtreecommitdiffstats
path: root/misc/tune2fs.c
diff options
context:
space:
mode:
Diffstat (limited to 'misc/tune2fs.c')
-rw-r--r--misc/tune2fs.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index cd2d622a..1576ce44 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -24,7 +24,9 @@
#include <fcntl.h>
#include <grp.h>
+#ifdef HAVE_GETOPT_H
#include <getopt.h>
+#endif
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
@@ -120,8 +122,10 @@ void main (int argc, char ** argv)
gr = getgrnam (optarg);
if (gr == NULL)
tmp = optarg;
- else
+ else {
resgid = gr->gr_gid;
+ *tmp =0;
+ }
}
if (*tmp)
{
@@ -194,8 +198,10 @@ void main (int argc, char ** argv)
pw = getpwnam (optarg);
if (pw == NULL)
tmp = optarg;
- else
+ else {
resuid = pw->pw_uid;
+ *tmp = 0;
+ }
}
if (*tmp)
{