comparison libpwon/readconf.c @ 953:ab54957dbe35

libpwon: implement -Petmoff mode
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 07 Jun 2023 20:06:12 +0000
parents 7d1df6d831e4
children
comparison
equal deleted inserted replaced
952:68d4474c1a36 953:ab54957dbe35
7 static char conf_file_pathname[] = "/opt/freecalypso/bootctrl.conf"; 7 static char conf_file_pathname[] = "/opt/freecalypso/bootctrl.conf";
8 8
9 #define MAX_BOOTCTRL_CONF_LINE 510 9 #define MAX_BOOTCTRL_CONF_LINE 510
10 10
11 char bootctrl_pwon_cmd[MAX_BOOTCTRL_CONF_LINE+1]; 11 char bootctrl_pwon_cmd[MAX_BOOTCTRL_CONF_LINE+1];
12 int bootctrl_etmoff_mode;
12 13
13 find_bootctrl_entry(soughtname) 14 find_bootctrl_entry(soughtname)
14 char *soughtname; 15 char *soughtname;
15 { 16 {
16 FILE *inf; 17 FILE *inf;
18 int lineno; 19 int lineno;
19 char *cp, *np; 20 char *cp, *np;
20 21
21 if (bootctrl_check_duart28c(soughtname)) 22 if (bootctrl_check_duart28c(soughtname))
22 return(0); 23 return(0);
24 if (!strcmp(soughtname, "etmoff")) {
25 bootctrl_etmoff_mode = 1;
26 return(0);
27 }
23 inf = fopen(conf_file_pathname, "r"); 28 inf = fopen(conf_file_pathname, "r");
24 if (!inf) { 29 if (!inf) {
25 perror(conf_file_pathname); 30 perror(conf_file_pathname);
26 return(-1); 31 return(-1);
27 } 32 }