Changeset 10254 for trunk/tools
- Timestamp:
- Sep 30, 2003, 3:29:07 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/CmdQd/CmdQd.c
r8483 r10254 1 /* $Id: CmdQd.c,v 1.1 8 2002-05-24 03:39:08bird Exp $1 /* $Id: CmdQd.c,v 1.19 2003-09-30 13:29:07 bird Exp $ 2 2 * 3 3 * Command Queue Daemon / Client. … … 115 115 * Header Files * 116 116 *******************************************************************************/ 117 #include <io.h> 117 118 #include <stdio.h> 118 119 #include <string.h> … … 1494 1495 { /* only do this once! */ 1495 1496 HFILE hf; 1497 ULONG ul = 0; 1498 1496 1499 fclose(stdin); 1500 close(HF_STDIN); 1497 1501 DosClose(HF_STDIN); 1498 hDummy = HF_STDIN; 1499 for (hf = 1; hf < 20; hf++) 1500 if (!(rcDbg = DosDupHandle(hf, &hDummy))) 1501 break; 1502 fclose(stdout); 1503 close(HF_STDOUT); 1504 DosClose(HF_STDOUT); 1505 fclose(stderr); 1506 close(HF_STDERR); 1507 DosClose(HF_STDERR); 1508 1509 hStdOut = HF_STDOUT; 1510 hStdErr = HF_STDERR; 1511 hDummy = -1; 1512 rcDbg = DosOpen("\\dev\\nul", &hDummy, &ul, 0, 0, 1513 OPEN_ACTION_FAIL_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS, 1514 OPEN_SHARE_DENYNONE | OPEN_ACCESS_WRITEONLY, NULL); 1502 1515 assert(!rcDbg); 1503 rcDbg = DosSetFHState(hDummy, OPEN_FLAGS_NOINHERIT); assert(!rcDbg); 1504 fclose(stdout); DosClose(HF_STDOUT); 1505 fclose(stderr); DosClose(HF_STDERR); 1506 hStdOut = HF_STDOUT; rcDbg = DosDupHandle(hDummy, &hStdOut);assert(!rcDbg); 1507 assert(hStdOut == HF_STDOUT); 1508 hStdErr = HF_STDERR; rcDbg = DosDupHandle(hDummy, &hStdErr);assert(!rcDbg); 1509 assert(hStdErr == HF_STDERR); 1516 rcDbg = DosSetFHState(hDummy, OPEN_FLAGS_NOINHERIT); 1517 for (hf = HF_STDIN; hf <= HF_STDERR; hf++) 1518 if (hDummy != hf) 1519 { 1520 rcDbg = DosDupHandle(hDummy, &hf); 1521 assert(!rcDbg); 1522 rcDbg = DosSetFHState(hf, OPEN_FLAGS_NOINHERIT); 1523 assert(!rcDbg); 1524 } 1510 1525 fStdClosed = TRUE; 1511 1526 }
Note:
See TracChangeset
for help on using the changeset viewer.