psmisc/psmisc-22.12.dif

38 lines
1.1 KiB
Plaintext
Raw Normal View History

--- src/fuser.c
+++ src/fuser.c 2010-07-13 15:01:58.000000000 +0000
@@ -1120,7 +1120,8 @@ int main(int argc, char *argv[])
char option_buf[3];
struct option *optr;
char *nsptr;
- int skip_argv;
+ int skip_argv;
+ int seen_file;
size_t len;
struct option options[] = {
@@ -1160,6 +1161,7 @@ int main(int argc, char *argv[])
netdev = find_net_dev();
fill_unix_cache(&unixsockets);
+ seen_file = 0;
for (argc_cnt = 1; argc_cnt < argc; argc_cnt++) {
current_argv = argv[argc_cnt];
if (current_argv[0] == '-') { /* its an option */
@@ -1291,6 +1293,7 @@ int main(int argc, char *argv[])
}
}
this_name->matched_procs = NULL;
+ seen_file = 1;
if (opts & (OPT_MOUNTS|OPT_ISMOUNTPOINT)
&& this_name->name_space != NAMESPACE_FILE)
usage(_
@@ -1350,7 +1353,7 @@ int main(int argc, char *argv[])
names_tail->next = this_name;
names_tail = this_name;
} /* for across the argvs */
- if (names_head == NULL)
+ if (names_head == NULL && !seen_file)
usage(_("No process specification given"));
if (opts & OPT_SILENT) {