lib/, src/: Use int main(void) where appropriate

Remove /*ARGSUSED*/ comments.  Instead, use appropriate declarators for
main().  ISO C allows using int main(void) if the parameters are going
to be unused.

Also, do some cosmetic changes in the uses of argc and argv, to show
where they are used.

And use *argv[], instead of **argv.  Array notation is friendlier, IMO.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
Alejandro Colomar
2024-01-18 01:30:23 +01:00
committed by Serge Hallyn
parent da440b536c
commit efd169e010
3 changed files with 13 additions and 16 deletions
+5 -5
View File
@@ -36,7 +36,8 @@ static void usage (void)
exit (EXIT_FAILURE);
}
/*ARGSUSED*/ int main (int argc, char **argv)
int
main(int argc, char *argv[])
{
uid_t ruid, euid;
gid_t rgid, egid;
@@ -74,11 +75,10 @@ static void usage (void)
*/
if (argc > 1) {
if ((argc > 2) || (strcmp (argv[1], "-a") != 0)) {
usage ();
} else {
if (argc > 2 || strcmp(argv[1], "-a") != 0)
usage();
else
aflg = true;
}
}
ruid = getuid ();
+7 -7
View File
@@ -53,8 +53,8 @@ static void catch_signals (MAYBE_UNUSED int sig)
}
/*ARGSUSED*/ int
main(int argc, char **argv)
int
main(int argc, char *argv[])
{
int err = 0;
char **envp = environ;
@@ -78,13 +78,13 @@ main(int argc, char **argv)
(void) bindtextdomain (PACKAGE, LOCALEDIR);
(void) textdomain (PACKAGE);
initenv ();
initenv();
if (argc > 1) {
close (0);
close (1);
close (2);
close(0);
close(1);
close(2);
if (open (argv[1], O_RDWR) >= 0) {
if (open(argv[1], O_RDWR) >= 0) {
dup (0);
dup (0);
} else {