/[baselayout]/trunk/src/rc.c
Gentoo

Diff of /trunk/src/rc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 3008 Revision 3009
203 } 203 }
204 *p = 0; 204 *p = 0;
205 } 205 }
206 206
207 if (message) 207 if (message)
208 fmt = strdup ("%s"); 208 fmt = xstrdup ("%s");
209 209
210 if (strcmp (applet, "einfo") == 0) 210 if (strcmp (applet, "einfo") == 0)
211 einfo (fmt, message); 211 einfo (fmt, message);
212 else if (strcmp (applet, "einfon") == 0) 212 else if (strcmp (applet, "einfon") == 0)
213 einfon (fmt, message); 213 einfon (fmt, message);
404 buffer[i] = 0; 404 buffer[i] = 0;
405 405
406 p += strlen (ent); 406 p += strlen (ent);
407 if (*p == '=') 407 if (*p == '=')
408 p++; 408 p++;
409 value = strdup (strsep (&p, " ")); 409 value = xstrdup (strsep (&p, " "));
410 } 410 }
411 } else 411 } else
412 errno = ENOENT; 412 errno = ENOENT;
413 fclose (fp); 413 fclose (fp);
414 414
755 DIR *dp; 755 DIR *dp;
756 struct dirent *d; 756 struct dirent *d;
757 757
758 atexit (cleanup); 758 atexit (cleanup);
759 if (argv[0]) 759 if (argv[0])
760 applet = strdup (basename (argv[0])); 760 applet = xstrdup (basename (argv[0]));
761 761
762 if (! applet) 762 if (! applet)
763 eerrorx ("arguments required"); 763 eerrorx ("arguments required");
764 764
765 /* These used to be programs in their own right, so we shouldn't 765 /* These used to be programs in their own right, so we shouldn't
856 /* No clearenv present here then. 856 /* No clearenv present here then.
857 We could manipulate environ directly ourselves, but it seems that 857 We could manipulate environ directly ourselves, but it seems that
858 some kernels bitch about this according to the environ man pages 858 some kernels bitch about this according to the environ man pages
859 so we walk though environ and call unsetenv for each value. */ 859 so we walk though environ and call unsetenv for each value. */
860 while (environ[0]) { 860 while (environ[0]) {
861 tmp = strdup (environ[0]); 861 tmp = xstrdup (environ[0]);
862 p = tmp; 862 p = tmp;
863 var = strsep (&p, "="); 863 var = strsep (&p, "=");
864 unsetenv (var); 864 unsetenv (var);
865 free (tmp); 865 free (tmp);
866 } 866 }
1308 1308
1309 /* Store the new runlevel */ 1309 /* Store the new runlevel */
1310 if (newlevel) { 1310 if (newlevel) {
1311 rc_runlevel_set (newlevel); 1311 rc_runlevel_set (newlevel);
1312 free (runlevel); 1312 free (runlevel);
1313 runlevel = strdup (newlevel); 1313 runlevel = xstrdup (newlevel);
1314 setenv ("RC_SOFTLEVEL", runlevel, 1); 1314 setenv ("RC_SOFTLEVEL", runlevel, 1);
1315 } 1315 }
1316 1316
1317 /* Run the halt script if needed */ 1317 /* Run the halt script if needed */
1318 if (strcmp (runlevel, RC_LEVEL_SHUTDOWN) == 0 || 1318 if (strcmp (runlevel, RC_LEVEL_SHUTDOWN) == 0 ||

Legend:
Removed from v.3008  
changed lines
  Added in v.3009

  ViewVC Help
Powered by ViewVC 1.1.20