mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-25 23:21:38 +01:00
Don't build format_helper_exit_status on win32
The only thing that used format_helper_exit_status on win32 was the unit tests. This caused an error when we tried to leave a static format_helper_exit_status lying around in a production object file. The easiest solution is to admit that this way of dealing with process exit status is Unix-only.
This commit is contained in:
parent
1556b0cb12
commit
449b2b7c58
2 changed files with 5 additions and 1 deletions
|
@ -3443,6 +3443,7 @@ format_hex_number_for_helper_exit_status(unsigned int x, char *buf,
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
/** Format <b>child_state</b> and <b>saved_errno</b> as a hex string placed in
|
/** Format <b>child_state</b> and <b>saved_errno</b> as a hex string placed in
|
||||||
* <b>hex_errno</b>. Called between fork and _exit, so must be signal-handler
|
* <b>hex_errno</b>. Called between fork and _exit, so must be signal-handler
|
||||||
* safe.
|
* safe.
|
||||||
|
@ -3551,6 +3552,7 @@ format_helper_exit_status(unsigned char child_state, int saved_errno,
|
||||||
done:
|
done:
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Maximum number of file descriptors, if we cannot get it via sysconf() */
|
/* Maximum number of file descriptors, if we cannot get it via sysconf() */
|
||||||
#define DEFAULT_MAX_FD 256
|
#define DEFAULT_MAX_FD 256
|
||||||
|
|
|
@ -2281,6 +2281,7 @@ test_util_load_win_lib(void *ptr)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
static void
|
static void
|
||||||
clear_hex_errno(char *hex_errno)
|
clear_hex_errno(char *hex_errno)
|
||||||
{
|
{
|
||||||
|
@ -2324,6 +2325,7 @@ test_util_exit_status(void *ptr)
|
||||||
done:
|
done:
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
/** Check that fgets waits until a full line, and not return a partial line, on
|
/** Check that fgets waits until a full line, and not return a partial line, on
|
||||||
|
@ -3346,8 +3348,8 @@ struct testcase_t util_tests[] = {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
UTIL_TEST(load_win_lib, 0),
|
UTIL_TEST(load_win_lib, 0),
|
||||||
#endif
|
#endif
|
||||||
UTIL_TEST(exit_status, 0),
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
|
UTIL_TEST(exit_status, 0),
|
||||||
UTIL_TEST(fgets_eagain, TT_SKIP),
|
UTIL_TEST(fgets_eagain, TT_SKIP),
|
||||||
#endif
|
#endif
|
||||||
UTIL_TEST(spawn_background_ok, 0),
|
UTIL_TEST(spawn_background_ok, 0),
|
||||||
|
|
Loading…
Add table
Reference in a new issue