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

Diff of /trunk/src/runscript.c

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

Revision 2741 Revision 2743
291 free (mtime_test); 291 free (mtime_test);
292 } 292 }
293 free (exclusive); 293 free (exclusive);
294 free (applet); 294 free (applet);
295 free (prefix); 295 free (prefix);
296 free (service);
296} 297}
297 298
298static int write_prefix (int fd, const char *buffer, size_t bytes, bool *prefixed) { 299static int write_prefix (int fd, const char *buffer, size_t bytes, bool *prefixed) {
299 unsigned int i; 300 unsigned int i;
300 int j; 301 int j;
990 bool doneone = false; 991 bool doneone = false;
991 char pid[16]; 992 char pid[16];
992 int retval; 993 int retval;
993 int opt; 994 int opt;
994 995
995 service = argv[1]; 996 /* We need the full path to the service */
997 if (*argv[1] == '/')
998 service = rc_xstrdup (argv[1]);
999 else {
1000 char pwd[PATH_MAX];
1001 if (! getcwd (pwd, PATH_MAX))
1002 eerrorx ("getcwd: %s", strerror (errno));
1003 service = rc_strcatpaths (pwd, argv[1], (char *) NULL);
1004 }
1005
996 applet = rc_xstrdup (basename (service)); 1006 applet = rc_xstrdup (basename (service));
997 atexit (cleanup); 1007 atexit (cleanup);
998 1008
999 /* Change dir to / to ensure all init scripts don't use stuff in pwd */ 1009 /* Change dir to / to ensure all init scripts don't use stuff in pwd */
1000 chdir ("/"); 1010 chdir ("/");

Legend:
Removed from v.2741  
changed lines
  Added in v.2743

  ViewVC Help
Powered by ViewVC 1.1.20