Cygwin: utils: convert usage() to proper noreturn function throughout
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
@@ -11,6 +11,7 @@ details. */
|
||||
#include <pwd.h>
|
||||
#include <grp.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <getopt.h>
|
||||
#include <sys/acl.h>
|
||||
@@ -48,7 +49,7 @@ groupname (gid_t gid)
|
||||
return gbuf;
|
||||
}
|
||||
|
||||
static void
|
||||
static void __attribute__ ((__noreturn__))
|
||||
usage (FILE * stream)
|
||||
{
|
||||
fprintf (stream, "Usage: %s [-adn] FILE [FILE2...]\n"
|
||||
@@ -97,6 +98,7 @@ usage (FILE * stream)
|
||||
" default:other::perm\n"
|
||||
"\n");
|
||||
}
|
||||
exit (stream == stdout ? 0 : 1);
|
||||
}
|
||||
|
||||
struct option longopts[] = {
|
||||
@@ -165,7 +167,6 @@ main (int argc, char **argv)
|
||||
break;
|
||||
case 'h':
|
||||
usage (stdout);
|
||||
return 0;
|
||||
case 'n':
|
||||
nopt = 1;
|
||||
break;
|
||||
@@ -177,10 +178,7 @@ main (int argc, char **argv)
|
||||
return 1;
|
||||
}
|
||||
if (optind > argc - 1)
|
||||
{
|
||||
usage (stderr);
|
||||
return 1;
|
||||
}
|
||||
usage (stderr);
|
||||
if (nopt)
|
||||
options |= TEXT_NUMERIC_IDS;
|
||||
if (eopt > 0)
|
||||
|
Reference in New Issue
Block a user