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

Diff of /trunk/src/librc-daemon.c

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

Revision 2866 Revision 2883
322 mpidfile = rc_xstrdup ("pidfile="); 322 mpidfile = rc_xstrdup ("pidfile=");
323 323
324 /* Regardless, erase any existing daemon info */ 324 /* Regardless, erase any existing daemon info */
325 if (rc_is_dir (dirpath)) { 325 if (rc_is_dir (dirpath)) {
326 char *oldfile = NULL; 326 char *oldfile = NULL;
327 files = rc_ls_dir (NULL, dirpath, 0); 327 files = rc_ls_dir (dirpath, 0);
328 STRLIST_FOREACH (files, file, i) { 328 STRLIST_FOREACH (files, file, i) {
329 ffile = rc_strcatpaths (dirpath, file, (char *) NULL); 329 ffile = rc_strcatpaths (dirpath, file, (char *) NULL);
330 nfiles++; 330 nfiles++;
331 331
332 if (! oldfile) { 332 if (! oldfile) {
405 file = rc_xmalloc (len); 405 file = rc_xmalloc (len);
406 snprintf (file, len, "%03d", indx); 406 snprintf (file, len, "%03d", indx);
407 retval = _match_daemon (dirpath, file, mexec, NULL, NULL); 407 retval = _match_daemon (dirpath, file, mexec, NULL, NULL);
408 free (file); 408 free (file);
409 } else { 409 } else {
410 char **files = rc_ls_dir (NULL, dirpath, 0); 410 char **files = rc_ls_dir (dirpath, 0);
411 STRLIST_FOREACH (files, file, i) { 411 STRLIST_FOREACH (files, file, i) {
412 retval = _match_daemon (dirpath, file, mexec, NULL, NULL); 412 retval = _match_daemon (dirpath, file, mexec, NULL, NULL);
413 if (retval) 413 if (retval)
414 break; 414 break;
415 } 415 }
452 free (dirpath); 452 free (dirpath);
453 return (false); 453 return (false);
454 } 454 }
455 455
456 memset (buffer, 0, sizeof (buffer)); 456 memset (buffer, 0, sizeof (buffer));
457 files = rc_ls_dir (NULL, dirpath, 0); 457 files = rc_ls_dir (dirpath, 0);
458 STRLIST_FOREACH (files, file, i) { 458 STRLIST_FOREACH (files, file, i) {
459 path = rc_strcatpaths (dirpath, file, (char *) NULL); 459 path = rc_strcatpaths (dirpath, file, (char *) NULL);
460 fp = fopen (path, "r"); 460 fp = fopen (path, "r");
461 free (path); 461 free (path);
462 if (! fp) { 462 if (! fp) {

Legend:
Removed from v.2866  
changed lines
  Added in v.2883

  ViewVC Help
Powered by ViewVC 1.1.20