added portability to non-BSD systems

This commit is contained in:
elvis
2022-04-11 18:38:04 +02:00
parent da270caea1
commit 31fda57145
5 changed files with 59 additions and 2 deletions

View File

@ -399,7 +399,7 @@ int main(int argc, char *argv[]) {
}
destroyThreadPool(pool, 0); // notifico che i thread dovranno uscire
clearWaiting(&waiting);
clearWaiting(&waiting); // destroy waiting list
taglia_stats(taglia, stdout); // print stats
// print all files in storage during shutdown

View File

@ -151,9 +151,17 @@ int parser(int len, char *command, queueT *queue, long fd_c, taglia_t* taglia, p
char *token2 = NULL;
char *token3 = NULL;
#if defined(__APPLE__) || defined(__FreeBSD__)
token = strsep(&string, "|");
token2 = strsep(&string, "|");
token3 = strsep(&string, "|");
#endif /* __APPLE__ or __FreeBSD__ */
#if defined(__linux__)
token = strsep_gnu(&string, "|");
token2 = strsep_gnu(&string, "|");
token3 = strsep_gnu(&string, "|");
#endif
if(!token)
goto _parser_cleanup;