#include <curl/stdcheaders.h>
#endif
-#ifdef _WIN32
-#define curlx_getpid() GetCurrentProcessId()
-#else
-#define curlx_getpid() getpid()
-#endif
-
/*
* Large file (>2Gb) support using Win32 functions.
*/
struct smb_header *h,
unsigned char cmd, size_t len)
{
- unsigned int pid;
+ const unsigned int pid = 0xbad71d; /* made up */
memset(h, 0, sizeof(*h));
h->nbt_length = htons((unsigned short) (sizeof(*h) - sizeof(unsigned int) +
h->flags2 = smb_swap16(SMB_FLAGS2_IS_LONG_NAME | SMB_FLAGS2_KNOWS_LONG_NAME);
h->uid = smb_swap16(smbc->uid);
h->tid = smb_swap16(req->tid);
- pid = (unsigned int)curlx_getpid();
h->pid_high = smb_swap16((unsigned short)(pid >> 16));
h->pid = smb_swap16((unsigned short) pid);
}
if(got_exit_signal) {
logmsg("========> %s dnsd (port: %d pid: %ld) exits with signal (%d)",
- ipv_inuse, (int)port, (long)curlx_getpid(), exit_signal);
+ ipv_inuse, (int)port, (long)our_getpid(), exit_signal);
/*
* To properly set the return status of the process we
* must raise the same signal SIGINT or SIGTERM that we
if(got_exit_signal) {
logmsg("========> %s rtspd (port: %d pid: %ld) exits with signal (%d)",
- ipv_inuse, (int)port, (long)curlx_getpid(), exit_signal);
+ ipv_inuse, (int)port, (long)our_getpid(), exit_signal);
/*
* To properly set the return status of the process we
* must raise the same signal SIGINT or SIGTERM that we
if(got_exit_signal) {
logmsg("========> %s sws (%s pid: %ld) exits with signal (%d)",
- socket_type, location_str, (long)curlx_getpid(), exit_signal);
+ socket_type, location_str, (long)our_getpid(), exit_signal);
/*
* To properly set the return status of the process we
* must raise the same signal SIGINT or SIGTERM that we
if(got_exit_signal) {
logmsg("========> %s tftpd (port: %d pid: %ld) exits with signal (%d)",
- ipv_inuse, (int)port, (long)curlx_getpid(), exit_signal);
+ ipv_inuse, (int)port, (long)our_getpid(), exit_signal);
/*
* To properly set the return status of the process we
* must raise the same signal SIGINT or SIGTERM that we
return r;
}
+#ifdef _WIN32
+#define t_getpid() GetCurrentProcessId()
+#else
+#define t_getpid() getpid()
+#endif
+
curl_off_t our_getpid(void)
{
- curl_off_t pid;
-
- pid = (curl_off_t)curlx_getpid();
+ curl_off_t pid = (curl_off_t)t_getpid();
#ifdef _WIN32
/* store pid + MAX_PID to avoid conflict with Cygwin/msys PIDs, see also:
* - 2019-01-31: https://cygwin.com/git/?p=newlib-cygwin.git;a=commit;