diff options
author | наб <nabijaczleweli@nabijaczleweli.xyz> | 2022-11-26 01:21:57 +0100 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2023-01-08 18:22:10 +0100 |
commit | 650cf0f13bf667270d0a6a4612437af264667585 (patch) | |
tree | 37116670b928be51c7052306b0aea6671eb6acec /linux/Platform.c | |
parent | 8def4d63cd9c216d89b785f858c866257f9a6768 (diff) |
Use a 0x{devnum} format for devices in lock screen, like files screen
Also reflow it to not be absolutely bonkers
Diffstat (limited to 'linux/Platform.c')
-rw-r--r-- | linux/Platform.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/linux/Platform.c b/linux/Platform.c index 4382c1ee..64f25c42 100644 --- a/linux/Platform.c +++ b/linux/Platform.c @@ -22,6 +22,7 @@ in the source distribution for its full text. #include <string.h> #include <time.h> #include <unistd.h> +#include <sys/sysmacros.h> #include "BatteryMeter.h" #include "ClockMeter.h" @@ -478,16 +479,18 @@ FileLocks_ProcessData* Platform_getProcessLocks(pid_t pid) { FileLocks_Data data = {.fd = file}; int _; + unsigned int maj, min; char lock_end[25], locktype[32], exclusive[32], readwrite[32]; if (10 != sscanf(buffer + strlen("lock:\t"), "%d: %31s %31s %31s %d %x:%x:%"PRIu64" %"PRIu64" %24s", &_, locktype, exclusive, readwrite, &_, - &data.dev[0], &data.dev[1], &data.inode, + &maj, &min, &data.inode, &data.start, lock_end)) continue; data.locktype = xStrdup(locktype); data.exclusive = xStrdup(exclusive); data.readwrite = xStrdup(readwrite); + data.dev = makedev(maj, min); if (String_eq(lock_end, "EOF")) data.end = ULLONG_MAX; |