Fix typo
[qemu] / linux-user / strace.c
index cc0f4d1..b4caffe 100644 (file)
@@ -154,6 +154,7 @@ print_newselect(const struct syscallname *name,
 }
 #endif
 
+#ifdef TARGET_NR_semctl
 static void
 print_semctl(const struct syscallname *name,
              abi_long arg1, abi_long arg2, abi_long arg3,
@@ -163,6 +164,7 @@ print_semctl(const struct syscallname *name,
     print_ipc_cmd(arg3);
     gemu_log(",0x" TARGET_ABI_FMT_lx ")", arg4);
 }
+#endif
 
 static void
 print_execve(const struct syscallname *name,
@@ -178,7 +180,7 @@ print_execve(const struct syscallname *name,
     unlock_user(s, arg1, 0);
 
     for (arg_ptr_addr = arg2; ; arg_ptr_addr += sizeof(abi_ulong)) {
-        abi_ulong *arg_ptr, arg_addr, s_addr;
+        abi_ulong *arg_ptr, arg_addr;
 
        arg_ptr = lock_user(VERIFY_READ, arg_ptr_addr, sizeof(abi_ulong), 1);
         if (!arg_ptr)
@@ -189,7 +191,7 @@ print_execve(const struct syscallname *name,
             break;
         if ((s = lock_user_string(arg_addr))) {
             gemu_log("\"%s\",", s);
-            unlock_user(s, s_addr, 0);
+            unlock_user(s, arg_addr, 0);
         }
     }
 
@@ -261,7 +263,7 @@ static const struct syscallname scnames[] = {
 #include "strace.list"
 };
 
-static int nsyscalls = sizeof(scnames)/sizeof(struct syscallname);
+static int nsyscalls = ARRAY_SIZE(scnames);
 
 /*
  * The public interface to this module.
@@ -312,4 +314,3 @@ print_syscall_ret(int num, abi_long ret)
             break;
         }
 }
-