739:bba6a6e221b4 | 740:f4ef952ad98b |
---|---|
1122 | 1122 |
1123 int util_exec_command(char *command, UcxBuffer *outbuf) { | 1123 int util_exec_command(char *command, UcxBuffer *outbuf) { |
1124 #ifdef _WIN32 | 1124 #ifdef _WIN32 |
1125 fprintf(stderr, "util_exec_command unsupported\n"); | 1125 fprintf(stderr, "util_exec_command unsupported\n"); |
1126 return NULL; | 1126 return NULL; |
1127 #endif | 1127 #else |
1128 | 1128 |
1129 int pout[2]; | 1129 int pout[2]; |
1130 if(pipe(pout)) { | 1130 if(pipe(pout)) { |
1131 perror("pipe"); | 1131 perror("pipe"); |
1132 return 1; | 1132 return 1; |
1166 | 1166 |
1167 posix_spawn_file_actions_destroy(&actions); | 1167 posix_spawn_file_actions_destroy(&actions); |
1168 close(pout[0]); | 1168 close(pout[0]); |
1169 | 1169 |
1170 return ret; | 1170 return ret; |
1171 #endif | |
1171 } | 1172 } |
1172 | 1173 |
1173 char* util_hexstr(const unsigned char *data, size_t len) { | 1174 char* util_hexstr(const unsigned char *data, size_t len) { |
1174 size_t buflen = 2*len + 4; | 1175 size_t buflen = 2*len + 4; |
1175 UcxBuffer *buf = ucx_buffer_new(malloc(buflen), buflen + 1, 0); | 1176 UcxBuffer *buf = ucx_buffer_new(malloc(buflen), buflen + 1, 0); |