mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 06:15:37 +00:00
Better comment about EOVERFLOW and pstat_getproc().
Also remove some useless casts.
This commit is contained in:
@@ -276,9 +276,10 @@ get_starttime(pid_t pid, struct timespec *starttime)
|
||||
|
||||
/*
|
||||
* Determine the start time from pst_start in struct pst_status.
|
||||
* We may get EOVERFLOW if the whole thing doesn't fit but that is OK.
|
||||
* EOVERFLOW is not a fatal error for the fields we use.
|
||||
* See the "EOVERFLOW Error" section of pstat_getvminfo(3).
|
||||
*/
|
||||
rc = pstat_getproc(&pstat, sizeof(pstat), (size_t)0, (int)pid);
|
||||
rc = pstat_getproc(&pstat, sizeof(pstat), 0, pid);
|
||||
if (rc != -1 || errno == EOVERFLOW) {
|
||||
starttime->tv_sec = pstat.pst_start;
|
||||
starttime->tv_nsec = 0;
|
||||
|
@@ -284,9 +284,10 @@ get_process_ttyname(char *name, size_t namelen)
|
||||
|
||||
/*
|
||||
* Determine the tty from psdev in struct pst_status.
|
||||
* We may get EOVERFLOW if the whole thing doesn't fit but that is OK.
|
||||
* EOVERFLOW is not a fatal error for the fields we use.
|
||||
* See the "EOVERFLOW Error" section of pstat_getvminfo(3).
|
||||
*/
|
||||
rc = pstat_getproc(&pstat, sizeof(pstat), (size_t)0, (int)getpid());
|
||||
rc = pstat_getproc(&pstat, sizeof(pstat), 0, getpid());
|
||||
if (rc != -1 || errno == EOVERFLOW) {
|
||||
if (pstat.pst_term.psd_major != -1 && pstat.pst_term.psd_minor != -1) {
|
||||
errno = serrno;
|
||||
|
Reference in New Issue
Block a user