7ca5dc4232b9ac5ee5cd25c8b5b33a58904cd251 didn't switch all callers over
to the new functions.
---
 toys/other/stat.c   | 4 ++--
 toys/pending/lsof.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
From fe9f8d0a9fbca386a1a426c699b97ad2b520f1f3 Mon Sep 17 00:00:00 2001
From: Elliott Hughes <[email protected]>
Date: Sat, 11 Jun 2016 22:00:54 -0700
Subject: [PATCH] Finish switching to dev_major/dev_minor.

7ca5dc4232b9ac5ee5cd25c8b5b33a58904cd251 didn't switch all callers over
to the new functions.
---
 toys/other/stat.c   | 4 ++--
 toys/pending/lsof.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/toys/other/stat.c b/toys/other/stat.c
index 47c10b4..9f77a60 100644
--- a/toys/other/stat.c
+++ b/toys/other/stat.c
@@ -114,8 +114,8 @@ static void print_stat(char type)
         xprintf(" -> `%s'", toybuf);
   } else if (type == 'o') out('u', stat->st_blksize);
   else if (type == 's') out('u', stat->st_size);
-  else if (type == 't') out('x', major(stat->st_rdev));
-  else if (type == 'T') out('x', minor(stat->st_rdev));
+  else if (type == 't') out('x', dev_major(stat->st_rdev));
+  else if (type == 'T') out('x', dev_minor(stat->st_rdev));
   else if (type == 'u') out('u', stat->st_uid);
   else if (type == 'U') xprintf("%8s", TT.user_name->pw_name);
   else if (type == 'x') date_stat_format((void *)&stat->st_atime);
diff --git a/toys/pending/lsof.c b/toys/pending/lsof.c
index e99b011..436fdd2 100644
--- a/toys/pending/lsof.c
+++ b/toys/pending/lsof.c
@@ -277,8 +277,8 @@ static void fill_stat(struct file_info *fi, const char *path)
   // Fill DEVICE.
   dev = (S_ISBLK(sb.st_mode) || S_ISCHR(sb.st_mode)) ? sb.st_rdev : sb.st_dev;
   if (!S_ISSOCK(sb.st_mode))
-    snprintf(fi->device, sizeof(fi->device), "%ld,%ld",
-             (long)major(dev), (long)minor(dev));
+    snprintf(fi->device, sizeof(fi->device), "%d,%d",
+             dev_major(dev), dev_minor(dev));
 
   // Fill SIZE/OFF.
   if (S_ISREG(sb.st_mode) || S_ISDIR(sb.st_mode))
-- 
2.8.0.rc3.226.g39d4020

_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to