void important_message(char *title, char *msgtext)
{
char buf[SIZ];
+ int rv;
switch (setup_type) {
sprintf(buf, "exec %s --msgbox '%s' 19 72",
getenv("CTDL_DIALOG"),
msgtext);
- system(buf);
+ rv = system(buf);
break;
case UI_SILENT:
fprintf(stderr, "%s\n", msgtext);
char buf[1024];
char outfilename[32];
int changes_made = 0;
+ int rv;
/* Determine the fully qualified path name of citserver */
snprintf(looking_for,
while (fgets(buf, sizeof buf, infp) != NULL) {
if (strstr(buf, looking_for) != NULL) {
- fwrite("#", 1, 1, outfp);
+ rv = fwrite("#", 1, 1, outfp);
++changes_made;
}
- fwrite(buf, strlen(buf), 1, outfp);
+ rv = fwrite(buf, strlen(buf), 1, outfp);
}
fclose(infp);
if (changes_made) {
sprintf(buf, "/bin/mv -f %s /etc/inittab 2>/dev/null", outfilename);
- system(buf);
- system("/sbin/init q 2>/dev/null");
+ rv = system(buf);
+ rv = system("/sbin/init q 2>/dev/null");
}
else {
unlink(outfilename);
FILE *fp;
char *initfile = "/etc/init.d/citadel";
char command[SIZ];
+ int rv;
if ((stat("/etc/init.d/", &etcinitd) == -1) &&
(errno == ENOENT))
chmod(initfile, 0755);
/* Set up the run levels. */
- system("/bin/rm -f /etc/rc?.d/[SK]??citadel 2>/dev/null");
+ rv = system("/bin/rm -f /etc/rc?.d/[SK]??citadel 2>/dev/null");
snprintf(command, sizeof(command), "for x in 2 3 4 5 ; do [ -d /etc/rc$x.d ] && ln -s %s /etc/rc$x.d/S79citadel ; done 2>/dev/null", initfile);
- system(command);
+ rv = system(command);
snprintf(command, sizeof(command),"for x in 0 6 S; do [ -d /etc/rc$x.d ] && ln -s %s /etc/rc$x.d/K30citadel ; done 2>/dev/null", initfile);
- system(command);
+ rv = system(command);
}
FILE *fp;
char buf[SIZ];
int already_citadel = 0;
+ int rv;
fp = fopen(filename, "r+");
if (fp == NULL) return; /* Not there. Oh well... */
fclose(fp);
/* Now try to restart the service */
- system("/etc/init.d/xinetd restart >/dev/null 2>&1");
+ rv = system("/etc/init.d/xinetd restart >/dev/null 2>&1");
}
char buf[SIZ];
FILE *fp;
int lines = 0;
+ int rv;
sprintf(buf, "/bin/ls -l /etc/rc*.d/S*%s 2>/dev/null; "
"/bin/ls -l /etc/rc.d/rc*.d/S*%s 2>/dev/null",
sprintf(buf, "for x in /etc/rc*.d/S*%s; do mv $x `echo $x |sed s/S/K/g`; done >/dev/null 2>&1", mta);
- system(buf);
+ rv = system(buf);
sprintf(buf, "/etc/init.d/%s stop >/dev/null 2>&1", mta);
- system(buf);
+ rv = system(buf);
}
char setupmsg[SIZ];
char dialog_result[PATH_MAX];
FILE *fp = NULL;
+ int rv;
strcpy(setupmsg, "");
prompt_text,
str,
dialog_result);
- system(buf);
+ rv = system(buf);
fp = fopen(dialog_result, "r");
if (fp != NULL) {
if (fgets(str, sizeof buf, fp)) {
{
FILE *fp;
int fd;
+ int rv;
if ((fd = creat(file_citadel_config, S_IRUSR | S_IWUSR)) == -1) {
display_error("setup: cannot open citadel.config");
display_error("setup: cannot open citadel.config");
cleanup(1);
}
- fwrite((char *) &config, sizeof(struct config), 1, fp);
+ rv = fwrite((char *) &config, sizeof(struct config), 1, fp);
fclose(fp);
}
int changed = 0;
int file_changed = 0;
char new_filename[64];
+ int rv;
fp_read = fopen(NSSCONF, "r");
if (fp_read == NULL) {
if (yesno(question, 1)) {
sprintf(buf, "/bin/mv -f %s %s", new_filename, NSSCONF);
- system(buf);
+ rv = system(buf);
chmod(NSSCONF, 0644);
}
unlink(new_filename);