From: Craig Small Date: Tue, 1 Sep 2015 10:41:25 +0000 (+1000) Subject: library: Remove tty_to_dev() X-Git-Tag: v4.0.0~1055 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6252bf439f0be386b8a9b2dbffb319d2d014cc70;p=procps-ng library: Remove tty_to_dev() This library call was imported into w as it was only used in this program. Converting a tty to a device is not really the work for libprocps. --- diff --git a/proc/devname.c b/proc/devname.c index 0066b461..e6d0b554 100644 --- a/proc/devname.c +++ b/proc/devname.c @@ -36,7 +36,6 @@ /* Who uses what: * - * tty_to_dev w (there is a fancy version in ps) * dev_to_tty top, ps */ @@ -319,17 +318,3 @@ abbrev: *ret = '\0'; return i; } - -/* name --> number */ -int tty_to_dev(const char *restrict const name) { - struct stat sbuf; - static char buf[32]; - if(name[0]=='/' && stat(name, &sbuf) >= 0) return sbuf.st_rdev; - snprintf(buf,32,"/dev/%s",name); - if(stat(buf, &sbuf) >= 0) return sbuf.st_rdev; - snprintf(buf,32,"/dev/tty%s",name); - if(stat(buf, &sbuf) >= 0) return sbuf.st_rdev; - snprintf(buf,32,"/dev/pts/%s",name); - if(stat(buf, &sbuf) >= 0) return sbuf.st_rdev; - return -1; -} diff --git a/proc/devname.h b/proc/devname.h index 1062ac5b..4517cc68 100644 --- a/proc/devname.h +++ b/proc/devname.h @@ -11,7 +11,5 @@ __BEGIN_DECLS extern unsigned dev_to_tty(char *__restrict ret, unsigned chop, dev_t dev_t_dev, int pid, unsigned int flags); -extern int tty_to_dev(const char *__restrict const name); - __END_DECLS #endif diff --git a/proc/libprocps.sym b/proc/libprocps.sym index 6f5156e5..6eba3dbd 100644 --- a/proc/libprocps.sym +++ b/proc/libprocps.sym @@ -19,7 +19,6 @@ global: readproctab3; readproctab; readtask; - tty_to_dev; user_from_uid; procps_cpu_count; procps_diskstat_dev_count;