diff -u -p a/notice/notice.c b/notice/notice.c --- a/notice/notice.c +++ b/notice/notice.c @@ -137,14 +137,14 @@ parse_opt (int key, char *arg, struct ar /* Open the file. */ file = file_name_lookup (arg, 0, 0); if (file == MACH_PORT_NULL) - error (1, errno, "Could not open %s", arg); + argp_error(state, arg); /* Create the notification port. */ err = ports_create_port (class, bucket, sizeof (struct notice_handle) + strlen (arg), ¬ice); if (err) - error (1, err, "Could not allocate port"); + argp_error(state, "Could not allocate port"); /* Record the file name and the changes we are interested in. */ strcpy (notice->name, arg); notice->changes = changes; @@ -153,7 +153,7 @@ parse_opt (int key, char *arg, struct ar err = file_notice_changes (file, ports_get_right (notice), MACH_MSG_TYPE_MAKE_SEND); if (err) - error (1, err, "Noticing changes not possible for %s", arg); + argp_error(state, arg); break; }