Patch will allow to use stdin/stdout on other than windows platforms.
Change-Id: I729ebd4efaa1675956b085e74b413805125a7d7a
Reviewed-on: https://code.wireshark.org/review/23676
Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jakub Zawadzki <darkjames-ws@darkjames.pl>
if (argc != 2)
{
- fprintf(stderr, "Usage: %s <socket>\n", argv[0]);
+ fprintf(stderr, "Usage: %s <-|socket>\n", argv[0]);
fprintf(stderr, "\n");
fprintf(stderr, "<socket> examples:\n");
_server_fd = fd;
}
+ if (!_use_stdinout)
+ {
+ /* all good - try to daemonize */
#ifndef _WIN32
- /* all good - try to daemonize */
- pid = fork();
- if (pid == -1)
- fprintf(stderr, "cannot go to background fork() failed: %s\n", g_strerror(errno));
+ pid = fork();
+ if (pid == -1)
+ fprintf(stderr, "cannot go to background fork() failed: %s\n", g_strerror(errno));
- if (pid != 0)
- {
- /* parent */
- exit(0);
- }
+ if (pid != 0)
+ {
+ /* parent */
+ exit(0);
+ }
#endif
+ }
return 0;
}