Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.85
 
1.86
 
MAIN:gmcgarry:20080415100331
 
cc.c
_>5050 #include "config.h"
 5151 
 5252 #include <sys/types.h>
<> 53+#ifdef HAVE_SYS_WAIT_H
5354 #include <sys/wait.h>
<> 55+#endif
5456 
 5557 #include <ctype.h>
 5658 #include <errno.h>
 5759 #include <fcntl.h>
<> 60+#ifdef HAVE_LIBGEN_H
5861 #include <libgen.h>
<> 62+#endif
5963 #include <signal.h>
 6064 #include <stdarg.h>
 6165 #include <stdio.h>
 6266 #include <stdlib.h>
 6367 #include <string.h>
<> 68+#ifdef HAVE_UNISTD_H
6469 #include <unistd.h>
<> 70+#endif
6571 
<> 72+#ifdef os_win32
  73+#include <windows.h>
  74+#include <process.h>
  75+#include <io.h>
  76+#endif
  77+
  78+#include "compat.h"
  79+
6680 #include "ccconfig.h"
 6781 /* C command */
 6882 
     
 !
745759         return(s);
 746760 }
 747761 
<> 762+
748763 int
<>749 -callsys(char f[], char *v[])
  764+callsys(char *f, char *v[])
750765 {
 751766         int t, status = 0;
<> 767+#ifndef os_win32
752768         pid_t p;
<> 769+#endif
753770         char *s;
 754771 
 755772         if (vflag) {
     
 !
759776                 fprintf(stderr, "\n");
 760777         }
 761778 
<> 779+#ifdef os_win32
  780+        {
  781+        STARTUPINFO si;
  782+        PROCESS_INFORMATION pi;
  783+        DWORD exitCode;
  784+        BOOL ok;
  785+
  786+        // Set up the start up info struct.
  787+        ZeroMemory(&si, sizeof(STARTUPINFO));
  788+        si.cb = sizeof(STARTUPINFO);
  789+        GetStartupInfo(&si);
  790+        ok = CreateProcess(f// the executable program
  791+                NULL,   // the command line arguments
  792+                NULL,       // ignored
  793+                NULL,       // ignored
  794+                TRUE,       // inherit handles
  795+                DETACHED_PROCESS | HIGH_PRIORITY_CLASS,
  796+                NULL,       // ignored
  797+                NULL,       // ignored
  798+                &si,
  799+                &pi);
  800+
  801+        if (!ok) {
  802+                printf("Try Again\n");
  803+                return 100;
  804+        }
  805+
  806+        GetExitCodeProcess(pi.hProcess, &exitCode);
  807+        return (exitCode != 0);
  808+        }
  809+#else
  810+
762811         if ((p = fork()) == 0) {
 763812                 if (Bflag) {
 764813                         size_t len = strlen(Bflag) + 8;
     
 !
791840         if (WIFSIGNALED(status))
 792841                 dexit(eflag);
 793842         errorx(8, "Fatal error in %s", f);
<> 843+#endif
794844 }
 795845 
 796846 char *
     
 !
815865 char *
 816866 gettmp(void)
 817867 {
<> 868+#ifdef os_win32
  869+#define BUFFSIZE 1000
  870+        DWORD pathSize;
  871+        char pathBuffer[BUFFSIZE];
  872+        char tempFilename[MAX_PATH];
  873+        UINT uniqueNum;
  874+
  875+        pathSize = GetTempPath(BUFFSIZE, pathBuffer);
  876+        if (pathSize < BUFFSIZE)
  877+                pathBuffer[pathSize] = 0;
  878+        else
  879+                pathBuffer[0] = 0;
  880+        uniqueNum = GetTempFileName(pathBuffer, "ctm", 0, tempFilename);
  881+        if (uniqueNum == 0) {
  882+                fprintf(stderr, "%s:\n", pathBuffer);
  883+                exit(8);
  884+        }
  885+        return copy(tempFilename);
  886+#else
818887         char *sfn = copy("/tmp/ctm.XXXXXX");
 819888         int fd = -1;
 820889 
     
 !
823892                 exit(8);
 824893         }
 825894         close(fd);
<>826 -
827895         return sfn;
<> 896+#endif
<_828897 }
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-08-23 15:25 +0200