~ubuntu-branches/ubuntu/utopic/gnustep-base/utopic

« back to all changes in this revision

Viewing changes to Source/NSProcessInfo.m

  • Committer: Package Import Robot
  • Author(s): Paul Gevers
  • Date: 2014-07-19 13:02:18 UTC
  • mfrom: (20.1.6 utopic-proposed)
  • Revision ID: package-import@ubuntu.com-20140719130218-pn967l7wzjjf90yi
Tags: 1.24.6-2ubuntu1
* debian/rules:
  - Print the config.log if configure fails to debug
    powerpc/ppc64el FTBFS. (LP: #1277975)

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
   Boston, MA 02111 USA.
24
24
 
25
25
   <title>NSProcessInfo class reference</title>
26
 
   $Date: 2012-01-03 03:31:41 -0700 (Tue, 03 Jan 2012) $ $Revision: 34399 $
 
26
   $Date: 2013-08-22 16:44:54 +0100 (Thu, 22 Aug 2013) $ $Revision: 37003 $
27
27
*/
28
28
 
29
29
/*************************************************************************
57
57
#import "common.h"
58
58
 
59
59
#include <stdio.h>
60
 
#include <string.h>
61
60
 
62
61
#ifdef HAVE_WINDOWS_H
63
62
#  include <windows.h>
64
63
#endif
65
64
 
66
 
#ifdef HAVE_STRERROR
67
 
#  include <errno.h>
68
 
#endif
69
 
 
70
65
#if     defined(HAVE_SYS_SIGNAL_H)
71
66
#  include      <sys/signal.h>
72
67
#elif   defined(HAVE_SIGNAL_H)
113
108
#include <crt_externs.h>
114
109
#endif
115
110
 
116
 
#import "GNUstepBase/GSConfig.h"
117
111
#import "Foundation/NSArray.h"
118
112
#import "Foundation/NSSet.h"
119
113
#import "Foundation/NSCharacterSet.h"
763
757
  if (_gnu_noobjc_argv == NULL)
764
758
    goto malloc_error;
765
759
 
766
 
 
767
 
  ifp=fopen(proc_file_name,"r");
 
760
  ifp = fopen(proc_file_name,"r");
768
761
  //freopen(proc_file_name, "r", ifp);
769
762
  if (ifp == NULL)
770
763
    {
786
779
          argument++;
787
780
          length = 0;
788
781
          if (c == EOF) // End of command line
789
 
            break;
 
782
            {
 
783
              _gnu_noobjc_argc = argument;
 
784
              break;
 
785
            }
790
786
        }
791
787
    }
792
788
  fclose(ifp);
793
 
  ifp=fopen(proc_file_name,"r");
 
789
  ifp = fopen(proc_file_name,"r");
794
790
  //freopen(proc_file_name, "r", ifp);
795
791
  if (ifp == NULL)
796
792
    {
797
 
      for (c = 0; c < _gnu_noobjc_argc; c++)
798
 
        free(_gnu_noobjc_argv[c]);
799
 
      free(_gnu_noobjc_argv);
 
793
      if (0 != _gnu_noobjc_argv)
 
794
        {
 
795
          for (c = 0; c < _gnu_noobjc_argc; c++)
 
796
            {
 
797
              free(_gnu_noobjc_argv[c]);
 
798
            }
 
799
          free(_gnu_noobjc_argv);
 
800
        }
800
801
      goto proc_fs_error;
801
802
    }
802
803
  argument = 0;
845
846
#endif /* HAVE_FUNCTION_STRERROR */
846
847
  fprintf(stderr, "Your gnustep-base library is compiled for a kernel supporting the /proc filesystem, but it can't access it.\n");
847
848
  fprintf(stderr, "You should recompile or change your kernel.\n");
 
849
  free(proc_file_name);
848
850
#ifdef HAVE_PROGRAM_INVOCATION_NAME
849
851
  fprintf(stderr, "We try to go on anyway; but the program will ignore any argument which were passed to it.\n");
850
852
  _gnu_noobjc_argc = 1;