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

Diff of /trunk/src/librc.c

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

Revision 2977 Revision 2978
129 free (path); 129 free (path);
130 return (retval); 130 return (retval);
131} 131}
132librc_hidden_def(rc_runlevel_exists) 132librc_hidden_def(rc_runlevel_exists)
133 133
134/* Resolve a service name to it's full path */ 134 /* Resolve a service name to it's full path */
135char *rc_service_resolve (const char *service) 135char *rc_service_resolve (const char *service)
136{ 136{
137 char buffer[PATH_MAX]; 137 char buffer[PATH_MAX];
138 char *file; 138 char *file;
139 int r = 0; 139 int r = 0;
439 439
440 return (state); 440 return (state);
441} 441}
442librc_hidden_def(rc_service_state) 442librc_hidden_def(rc_service_state)
443 443
444char *rc_service_option_get (const char *service, const char *option) 444char *rc_service_value_get (const char *service, const char *option)
445{ 445{
446 FILE *fp; 446 FILE *fp;
447 char buffer[RC_LINEBUFFER]; 447 char buffer[RC_LINEBUFFER];
448 char *file = rc_strcatpaths (RC_SVCDIR, "options", service, option, 448 char *file = rc_strcatpaths (RC_SVCDIR, "options", service, option,
449 (char *) NULL); 449 (char *) NULL);
457 } 457 }
458 free (file); 458 free (file);
459 459
460 return (value); 460 return (value);
461} 461}
462librc_hidden_def(rc_service_option_get) 462librc_hidden_def(rc_service_value_get)
463 463
464bool rc_service_option_set (const char *service, const char *option, 464bool rc_service_value_set (const char *service, const char *option,
465 const char *value) 465 const char *value)
466{ 466{
467 FILE *fp; 467 FILE *fp;
468 char *path = rc_strcatpaths (RC_SVCDIR, "options", service, (char *) NULL); 468 char *path = rc_strcatpaths (RC_SVCDIR, "options", service, (char *) NULL);
469 char *file = rc_strcatpaths (path, option, (char *) NULL); 469 char *file = rc_strcatpaths (path, option, (char *) NULL);
470 bool retval = false; 470 bool retval = false;
486 486
487 free (path); 487 free (path);
488 free (file); 488 free (file);
489 return (retval); 489 return (retval);
490} 490}
491librc_hidden_def(rc_service_option_set) 491librc_hidden_def(rc_service_value_set)
492 492
493static pid_t _exec_service (const char *service, const char *arg) 493static pid_t _exec_service (const char *service, const char *arg)
494{ 494{
495 char *file; 495 char *file;
496 char *fifo; 496 char *fifo;
526 free (fifo); 526 free (fifo);
527 free (file); 527 free (file);
528 528
529 if (pid == -1) 529 if (pid == -1)
530 fprintf (stderr, "vfork: %s\n", strerror (errno)); 530 fprintf (stderr, "vfork: %s\n", strerror (errno));
531 531
532 return (pid); 532 return (pid);
533} 533}
534 534
535int rc_waitpid (pid_t pid) 535int rc_waitpid (pid_t pid)
536{ 536{

Legend:
Removed from v.2977  
changed lines
  Added in v.2978

  ViewVC Help
Powered by ViewVC 1.1.20