Permalink
Browse files

Check for HAVE_STRUCT_STAT_ST_RDEV before using struct stat st_rdev

Improves portability to some UNIXen.
  • Loading branch information...
pabs3 committed Mar 26, 2018
1 parent 75dc5d1 commit bdcc40e8252d0bcdf19312ca19ec533cabf8f14e
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/procinfo.c
@@ -112,7 +112,11 @@ int get_term(char *tty)
memset(buf, 0, sizeof buf);
snprintf(buf, sizeof buf - 1, "/dev/%s", tty);
if(stat(buf, &s) == -1) return -1;
#ifdef HAVE_STRUCT_STAT_ST_RDEV
return s.st_rdev;
#else
return -1;
#endif
}
/*

0 comments on commit bdcc40e

Please sign in to comment.