Changeset 3458 for trunk/src/kash/shfile.c
- Timestamp:
- Sep 14, 2020, 11:46:32 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/shfile.c
r3454 r3458 921 921 * Safe to call more than once. 922 922 */ 923 void shfile_uninit(shfdtab *pfdtab )923 void shfile_uninit(shfdtab *pfdtab, int tracefd) 924 924 { 925 925 if (!pfdtab) … … 930 930 unsigned left = pfdtab->size; 931 931 struct shfile *pfd = pfdtab->tab; 932 unsigned tracefdfound = 0; 932 933 while (left-- > 0) 933 934 { 934 935 if (pfd->fd != -1) 935 936 { 937 if (pfd->fd != tracefd) 938 { 936 939 #if K_OS == K_OS_WINDOWS 937 BOOL rc = CloseHandle((HANDLE)pfd->native); 938 assert(rc == TRUE); K_NOREF(rc); 939 #else 940 int rc = close((int)pfd->native); 941 assert(rc == 0); K_NOREF(rc); 942 #endif 943 pfd->fd = -1; 944 pfd->native = -1; 940 BOOL rc = CloseHandle((HANDLE)pfd->native); 941 assert(rc == TRUE); K_NOREF(rc); 942 #else 943 int rc = close((int)pfd->native); 944 assert(rc == 0); K_NOREF(rc); 945 #endif 946 pfd->fd = -1; 947 pfd->native = -1; 948 } 949 else 950 tracefdfound++; /* there is only the one */ 945 951 } 946 952 pfd++; 947 953 } 954 955 if (!tracefdfound) 956 { /* likely */ } 957 else 958 return; 948 959 949 960 sh_free(NULL, pfdtab->tab);
Note:
See TracChangeset
for help on using the changeset viewer.