Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Mar 2002 02:30:49 +0300 (MSK)
From:      "Andrew L. Neporada" <andr@dgap.mipt.ru>
To:        freebsd-bugs@freebsd.org
Cc:        freebsd-hackers@freebsd.org
Subject:   [PATCH] exit status of mtree(1)
Message-ID:  <20020310015221.J11778-200000@nas.dgap.mipt.ru>

next in thread | raw e-mail | index | archive | help
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

--0-793760758-1015716649=:11778
Content-Type: TEXT/PLAIN; charset=US-ASCII

According to man page, mtree should exit with a status of 0 on success
(directory matches spec.), 1 if any error occurred and 2 in the case of
directory with spec. mismatch. But our mtree(1) is badly broken here
(see f.e. bin/28424).

Attached patch solves (I hope) this problem. This patch also introduces
slightly enhanced exit status reporting:

0 - directory matches spec, success
1 - "hard error" -- spec/dir not found, wrong options, etc.
2 - directory/spec mismatch that was fixed successfully
3 - unfixed directory/spec mismatch

Please comment/review.

				Andrew.

--0-793760758-1015716649=:11778
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="mtree.diff"
Content-Transfer-Encoding: BASE64
Content-ID: <20020310023049.P11778@nas.dgap.mipt.ru>
Content-Description: mtree.diff
Content-Disposition: attachment; filename="mtree.diff"

SW5kZXg6IGNvbXBhcmUuYw0KPT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KUkNT
IGZpbGU6IC9ob21lL25jdnMvc3JjL3Vzci5zYmluL210cmVlL2NvbXBhcmUu
Yyx2DQpyZXRyaWV2aW5nIHJldmlzaW9uIDEuMjANCmRpZmYgLXUgLXIxLjIw
IGNvbXBhcmUuYw0KLS0tIGNvbXBhcmUuYwk2IE9jdCAyMDAwIDEyOjQ4OjU1
IC0wMDAwCTEuMjANCisrKyBjb21wYXJlLmMJNyBNYXIgMjAwMiAyMjo1Njoy
NSAtMDAwMA0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mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020310015221.J11778-200000>