]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lslocks: (fix) set JSON type for COL_SIZE even when --bytes is specified
authorMasatake YAMATO <yamato@redhat.com>
Thu, 30 Nov 2023 02:56:31 +0000 (11:56 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Thu, 30 Nov 2023 02:56:31 +0000 (11:56 +0900)
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
misc-utils/lslocks.c

index 0e6c6815f0d3e61499facc76368a909aeee936ec..f4f6618bf9a297dd81266613d0d0ea4313c59328 100644 (file)
@@ -760,8 +760,10 @@ static int show_locks(struct list_head *locks, pid_t target_pid, void *pid_locks
 
                        switch (id) {
                        case COL_SIZE:
-                               if (!bytes)
+                               if (!bytes) {
+                                       scols_column_set_json_type(cl, SCOLS_JSON_STRING);
                                        break;
+                               }
                                /* fallthrough */
                        case COL_PID:
                        case COL_START: