tools/gdbsx: Use right path for privcmd on NetBSD
authorManuel Bouyer <bouyer@netbsd.org>
Tue, 12 Jan 2021 18:12:28 +0000 (19:12 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 18 Jan 2021 19:07:37 +0000 (19:07 +0000)
On NetBSD the privcmd interface node is /kern/xen/privcmd

Signed-off-by: Manuel Bouyer <bouyer@netbsd.org>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
tools/debugger/gdbsx/xg/xg_main.c

index a4e8653168c78b006daa92f8d1a2b664f728461d..4576c762af0c29521e75db5ba3355d89250a0047 100644 (file)
@@ -126,11 +126,11 @@ xg_init()
     int flags, saved_errno;
 
     XGTRC("E\n");
-    if ((_dom0_fd=open("/dev/xen/privcmd", O_RDWR)) == -1) {
-        if ((_dom0_fd=open("/proc/xen/privcmd", O_RDWR)) == -1) {
-            perror("Failed to open /dev/xen/privcmd or /proc/xen/privcmd\n");
-            return -1;
-        }
+    if ((_dom0_fd=open("/dev/xen/privcmd", O_RDWR)) == -1 &&
+        (_dom0_fd=open("/proc/xen/privcmd", O_RDWR)) == -1 &&
+        (_dom0_fd=open("/kern/xen/privcmd", O_RDWR)) == -1) {
+        perror("Failed to open privcmd\n");
+        return -1;
     }
     /* Although we return the file handle as the 'xc handle' the API
      * does not specify / guarentee that this integer is in fact