Browse Source

utime: fix omission of field names in utimbuf structure printing

* utime.c (SYS_FUNC(utime)): Print struct utimbuf as a structure,
not as an array (use curly brackets instead of square ones).
Add field names to the output.
* tests/utime.c (main): Update expected output.
Eugene Syromyatnikov 3 years ago
parent
commit
922712f8ff
2 changed files with 5 additions and 5 deletions
  1. 3
    3
      tests/utime.c
  2. 2
    2
      utime.c

+ 3
- 3
tests/utime.c View File

@@ -54,11 +54,11 @@ main(void)
54 54
 
55 55
 	rc = utime("utime\nfilename", tail_u);
56 56
 	const char *errstr = sprintrc(rc);
57
-	printf("utime(\"utime\\nfilename\", [");
57
+	printf("utime(\"utime\\nfilename\", {actime=");
58 58
 	print_tm(p);
59
-	printf(", ");
59
+	printf(", modtime=");
60 60
 	print_tm(p);
61
-	printf("]) = %s\n", errstr);
61
+	printf("}) = %s\n", errstr);
62 62
 
63 63
 	puts("+++ exited with 0 +++");
64 64
 	return 0;

+ 2
- 2
utime.c View File

@@ -15,8 +15,8 @@ SYS_FUNC(utime)
15 15
 	printpath(tcp, tcp->u_arg[0]);
16 16
 	tprints(", ");
17 17
 	if (!umove_or_printaddr(tcp, tcp->u_arg[1], &u)) {
18
-		tprintf("[%s,", sprinttime(u.actime));
19
-		tprintf(" %s]", sprinttime(u.modtime));
18
+		tprintf("{actime=%s,", sprinttime(u.actime));
19
+		tprintf(" modtime=%s}", sprinttime(u.modtime));
20 20
 	}
21 21
 
22 22
 	return RVAL_DECODED;

Loading…
Cancel
Save