]> granicus.if.org Git - strace/commitdiff
Mpersify hdio.c
authorDmitry V. Levin <ldv@altlinux.org>
Mon, 30 May 2016 00:25:03 +0000 (00:25 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 30 May 2016 00:29:14 +0000 (00:29 +0000)
* defs.h (hdio_ioctl): Remove.
* hdio.c: Mpersify struct hd_geometry.
(hdio_ioctl): Mpersify.

defs.h
hdio.c

diff --git a/defs.h b/defs.h
index e221d4c33644954b33519b2e61b75296d48057cc..f7a85cad5f20f0a1b42966cd35de017b22242e19 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -662,7 +662,6 @@ extern void print_struct_statfs64(struct tcb *tcp, long, unsigned long);
 
 extern int file_ioctl(struct tcb *, const unsigned int, long);
 extern int fs_x_ioctl(struct tcb *, const unsigned int, long);
-extern int hdio_ioctl(struct tcb *, const unsigned int, long);
 extern int loop_ioctl(struct tcb *, const unsigned int, long);
 extern int ptp_ioctl(struct tcb *, const unsigned int, long);
 extern int scsi_ioctl(struct tcb *, const unsigned int, long);
diff --git a/hdio.c b/hdio.c
index 1553825aa5b6a61fae76aef6d5495a220baa4a6d..e9dbdf1ac11d4b25d32e8b806879fcf72df85550 100644 (file)
--- a/hdio.c
+++ b/hdio.c
  */
 
 #include "defs.h"
+
+#include DEF_MPERS_TYPE(struct_hd_geometry)
+
 #include <linux/hdreg.h>
 
-int
-hdio_ioctl(struct tcb *tcp, const unsigned int code, const long arg)
+typedef struct hd_geometry struct_hd_geometry;
+
+#include MPERS_DEFS
+
+MPERS_PRINTER_DECL(int, hdio_ioctl, struct tcb *tcp,
+                  const unsigned int code, const long arg)
 {
        switch (code) {
        case HDIO_GETGEO:
                if (entering(tcp))
                        return 0;
                else {
-                       struct hd_geometry geo;
+                       struct_hd_geometry geo;
 
                        tprints(", ");
                        if (!umove_or_printaddr(tcp, arg, &geo))
                                tprintf("{heads=%u, sectors=%u, "
-                                       "cylinders=%u, start=%lu}",
-                                       (unsigned)geo.heads,
-                                       (unsigned)geo.sectors,
-                                       (unsigned)geo.cylinders,
-                                       geo.start);
+                                       "cylinders=%hu, start=%lu}",
+                                       (unsigned) geo.heads,
+                                       (unsigned) geo.sectors,
+                                       geo.cylinders,
+                                       (unsigned long) geo.start);
                }
                break;
        default: