[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-dev] pid_t and MSVC



The use of 'pid_t' confuses me a bit:

In common/procmon.c (inside MS_WINDOWS), it's typedef'ed to 'int' unconditionally.

And then in common/util.* (tor_terminate_process()) it is assumed to be defined in orconfig.h or somewhere else. It's not AFAICS.

It is true that _getpid() returns an 'int', but the way Tor uses it seems
wrong; the last argument to OpenProcess() takes a 'DWORD'. So 'pid_t'
should be 'DWORD' IMHO.

So maybe we should introduce a 'typedef DWORD tor_pid_t;' in orconfig.h?

Btw. MingW does have 'pid_t' in it's <sys/types.h>.

--gv
_______________________________________________
tor-dev mailing list
tor-dev@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev