--- freem/src/fmadm.c 2025/04/04 19:43:18 1.31 +++ freem/src/fmadm.c 2025/04/09 19:52:02 1.32 @@ -1,5 +1,5 @@ /* - * $Id: fmadm.c,v 1.31 2025/04/04 19:43:18 snw Exp $ + * $Id: fmadm.c,v 1.32 2025/04/09 19:52:02 snw Exp $ * FreeM Administration Tool * * @@ -24,6 +24,9 @@ * along with FreeM. If not, see . * * $Log: fmadm.c,v $ + * Revision 1.32 2025/04/09 19:52:02 snw + * Eliminate as many warnings as possible while building with -Wall + * * Revision 1.31 2025/04/04 19:43:18 snw * Switch to using environment catalog to determine user and group for environment, and remove -u and -g flags from freem * @@ -1171,8 +1174,6 @@ long fm_get_pid (char *env) { char pid_file[4096]; char tmp_pid[255]; - long res; - FILE *fp; snprintf (pid_file, 4095, "%s/freem/run/%s.pid", LOCALSTATEDIR, env); @@ -1433,7 +1434,7 @@ int fm_daemonctl (short action, short ob case ACT_STATUS: epid = fm_get_pid (cur_env); if (epid > -1) { - fprintf (stderr, " - %s environment daemon running as pid %d\n", cur_env, epid); + fprintf (stderr, " - %s environment daemon running as pid %ld\n", cur_env, epid); } else { fprintf (stderr, " - %s environment daemon does not appear to be running\n", cur_env); @@ -1459,7 +1460,6 @@ void fm_checkperms(void) void fm_reconfigure(void) { char config_backup[4096]; - char vers[4096]; int retval; @@ -1538,7 +1538,6 @@ void fm_configure (void) int reconfigure = FALSE; struct stat etcstat; - int stat_result; DIR *dir; struct dirent *ent; @@ -1549,27 +1548,22 @@ void fm_configure (void) char *groupname = env_group; #if !defined(__OS2__) + struct group *d_grp; + struct passwd *d_user; + if (geteuid () != 0) { fprintf (stderr, "fmadm: not superuser\n"); exit (1); } - struct group *d_grp; - struct passwd *d_user; - gid_t d_gid; - uid_t d_uid; - if ((d_grp = getgrnam (groupname)) == NULL) { fprintf (stderr, "fmadm: '%s' group must exist before configuring\n", groupname); exit (1); } - d_gid = d_grp->gr_gid; - if ((d_user = getpwnam (username)) == NULL) { fprintf (stderr, "fmadm: '%s' user must exist before configuring\n", username); exit (1); } - d_uid = d_user->pw_uid; #endif snprintf (varbase, 4095, "%s/freem", LOCALSTATEDIR); @@ -1778,8 +1772,6 @@ void fm_configure (void) fprintf (stderr, "[OK]\n"); } else { - char modtmp[255]; - fprintf (stderr, "\nUpdating %s: \n", env_config_file); update_conf (env_config_file, fma_environment, "user", env_user);