source: trunk/dports/editors/jove/files/patch-proc.c.diff @ 2311

Last change on this file since 2311 was 2311, checked in by michaelm, 17 years ago

new port: Jove.
Bug: 387
Submitted by: vivek@…
Reviewed by:
Approved by:
Obtained from:

  • Property svn:eol-style set to native
File size: 936 bytes
  • proc.c

    old new  
    827827                int     ph;
    828828
    829829                swritef(pnbuf, sizeof(pnbuf), "%s/%s", TmpDir, "jpXXXXXX");
     830#ifndef NO_MKSTEMP
     831                pipename = pnbuf;
     832                ph = mkstemp( pipename );
     833#else
    830834                pipename = mktemp(pnbuf);
    831                 if ((ph = creat(pipename, S_IWRITE|S_IREAD)) < 0)
     835                ph = creat(pipename, S_IWRITE|S_IREAD);
     836#endif
     837                if (ph == -1)
    832838                        complain("cannot make pipe for filter: %s", strerror(errno));
    833839                close(1);
    834840                close(2);
     
    923929        jmp_buf sav_jmp;
    924930
    925931        swritef(tnambuf, sizeof(tnambuf), "%s/%s", TmpDir, "jfXXXXXX");
     932#ifndef NO_MKSTEMP
     933        {
     934                int fd = mkstemp(tnambuf);
     935                if ( fd == -1 )
     936                        complain( "can't create temp file %s: %s",
     937                                  tnambuf, strerror(errno) );
     938                close( fd );
     939                tname = tnambuf;
     940        }
     941#else
    926942        tname = mktemp(tnambuf);
     943#endif
    927944        fp = open_file(tname, iobuff, F_WRITE, YES);
    928945        push_env(sav_jmp);
    929946        if (setjmp(mainjmp) == 0) {
Note: See TracBrowser for help on using the repository browser.