~ubuntu-branches/ubuntu/intrepid/gnunet/intrepid

« back to all changes in this revision

Viewing changes to src/util/os/osconfig.c

  • Committer: Bazaar Package Importer
  • Author(s): Bhavani Shankar
  • Date: 2008-08-19 19:44:30 UTC
  • mfrom: (1.2.12 upstream) (3.1.2 lenny)
  • Revision ID: james.westby@ubuntu.com-20080819194430-x5gjv8wd7t7ldkp0
Tags: 0.8.0a-1ubuntu1
* Merge from debian unstable, remaining changes: (LP: #256576)
  - debian/rules:
   + Make use of code from cdbs' clean-la.mk file to clear the
      dependency_libs field in all .la files in the gnunet-dev 
      package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
309
309
#else
310
310
  struct stat buf;
311
311
  int ret;
 
312
  int i;
312
313
  char *initscript;
313
314
 
314
 
  initscript = GNUNET_malloc (strlen (servicename) + 13);
 
315
  i = strlen (application) - 1;
 
316
  if (i <= 0)
 
317
    return GNUNET_SYSERR;
 
318
  while ((i > 0) && (application[i] != DIR_SEPARATOR))
 
319
    i--;
 
320
 
 
321
  initscript = GNUNET_malloc (strlen (&application[i]) + 13);
315
322
  strcpy (initscript, "/etc/init.d/");
316
 
  strcat (initscript, servicename);
 
323
  strcat (initscript, &application[i]);
317
324
 
318
325
  /* Unix */
319
326
  if ((ACCESS ("/usr/sbin/update-rc.d", X_OK) != 0))
484
491
      errno = 0;
485
492
      if (ACCESS ("/usr/sbin/update-rc.d", W_OK) == 0)
486
493
        {
487
 
          if (-1 != system ("/usr/sbin/update-rc.d gnunetd remove"))
 
494
          ret = system ("/usr/sbin/update-rc.d gnunetd remove");
 
495
          if (ret != 0)
488
496
            {
489
497
              GNUNET_GE_LOG_STRERROR_FILE (ectx,
490
498
                                           GNUNET_GE_WARNING | GNUNET_GE_USER
497
505
        }
498
506
      else if (ACCESS ("/sbin/rc-update", W_OK) == 0)
499
507
        {
500
 
          if (-1 != system ("/sbin/rc-update del gnunetd"))
 
508
          ret = system ("/sbin/rc-update del gnunetd");
 
509
          if (ret != 0)
501
510
            {
502
511
              GNUNET_GE_LOG_STRERROR_FILE (ectx,
503
512
                                           GNUNET_GE_WARNING | GNUNET_GE_USER