Changeset 1500:789ffe085574 in roaraudio
- Timestamp:
- 03/31/09 20:53:38 (15 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/lib.c
r1197 r1500 26 26 27 27 int lib_run_bg(char * cmd, int infh, int outfh, int errfh, int * closefh, int lenclose) { 28 #ifdef ROAR_HAVE_FORK 28 29 pid_t child = fork(); 29 30 int fh[3] = {-1, -1, -1}; … … 50 51 // TODO: test for errors here. 51 52 53 #ifdef ROAR_SUPPORT_LISTEN 52 54 close(g_listen_socket); // listen socket. 55 #endif 53 56 54 57 // this breaks the new driver interface … … 58 61 59 62 // close fh's we got ask to close: 63 #ifdef ROAR_HAVE_IO_POSIX 60 64 for (i = 0; i < lenclose; i++) 61 65 close(closefh[i]); 66 #else 67 if ( lenclose ) { 68 ROAR_WARN("lib_run_bg(*): lenclose > 0 and no way known to close fds"); 69 } 70 #endif 62 71 63 72 // next we need to remap our stdio: … … 65 74 66 75 for (i = 0; i < 3; i++) { 76 #ifdef ROAR_HAVE_IO_POSIX 67 77 close(i); 78 #endif 68 79 dup2(fh[i], i); // todo test if this is ok. 69 80 close(fh[i]); … … 76 87 // still alive? BAD! 77 88 ROAR_ERR("lib_run_bg(*): We are still alive! BAD!"); 78 _exit(3);89 ROAR_U_EXIT(3); 79 90 return -1; 91 #else 92 return -1; 93 #endif 80 94 } 81 95
Note: See TracChangeset
for help on using the changeset viewer.