Ignore:
Timestamp:
Mar 1, 2009, 6:18:30 AM (16 years ago)
Author:
bird
Message:

kash: no return indicators that works for both gcc and msc (not pretty, but wtf).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/shfile.c

    r2297 r2298  
    625625    SecurityAttributes.bInheritHandle = TRUE;
    626626
    627     if (!CreatePipe(&hRead, &hWrite, &SecurityAttributes, 4096))
     627    fds[1] = fds[0] = -1;
     628    if (CreatePipe(&hRead, &hWrite, &SecurityAttributes, 4096))
    628629    {
    629630        fds[0] = shfile_insert(pfdtab, (intptr_t)hRead, O_RDONLY, -1, "shfile_pipe");
     
    637638# else
    638639    int native_fds[2];
     640
     641    fds[1] = fds[0] = -1;
    639642    if (!pipe(native_fds))
    640643    {
    641         fds[1] = -1;
    642644        fds[0] = shfile_insert(pfdtab, native_fds[0], O_RDONLY, -1, "shfile_pipe");
    643645        if (fds[0] != -1)
     
    673675            rc = -1;
    674676        }
     677    }
     678    else
     679    {
     680# if K_OS == K_OS_WINDOWS
     681        errno = shfile_dos2errno(GetLastError());
     682# endif
     683        rc = -1;
    675684    }
    676685
Note: See TracChangeset for help on using the changeset viewer.