From owner-p4-projects Sun Sep 29 20:31:12 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A91B337B404; Sun, 29 Sep 2002 20:31:09 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 52ACC37B401 for ; Sun, 29 Sep 2002 20:31:09 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0BAD743E42 for ; Sun, 29 Sep 2002 20:31:09 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from freefall.freebsd.org (perforce@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g8U3V8Co092148 for ; Sun, 29 Sep 2002 20:31:08 -0700 (PDT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g8U3V8uI092145 for perforce@freebsd.org; Sun, 29 Sep 2002 20:31:08 -0700 (PDT) Date: Sun, 29 Sep 2002 20:31:08 -0700 (PDT) Message-Id: <200209300331.g8U3V8uI092145@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 18354 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://people.freebsd.org/~peter/p4db/chv.cgi?CH=18354 Change 18354 by rwatson@rwatson_tislabs on 2002/09/29 20:30:58 Clean up MAC label processing in ls slightly. Note that this code is currently wrong because it doesn't construct the correct path to the object that it's going to retrieve labels for, so depending on the invocation, this may or may not work well. I'll clean it up tomorrow sometime. Affected files ... .. //depot/projects/trustedbsd/mac/bin/ls/ls.c#11 edit Differences ... ==== //depot/projects/trustedbsd/mac/bin/ls/ls.c#11 (text+ko) ==== @@ -693,12 +693,19 @@ goto label_out; } - error = mac_get_file(cur->fts_name, - label); - if (error != MAC_SUCCESS) { - fprintf(stderr, "%s: %s\n", - cur->fts_name, - mac_error(error)); +#if 0 + if (S_ISLNK(sp->st_mode)) +#endif + error = mac_get_link( + cur->fts_path, label); +#if 0 + else + error = mac_get_file( + cur->fts_name, label); +#endif + if (error == -1) { + perror(cur->fts_name); + mac_free(label); goto label_out; } @@ -708,13 +715,13 @@ fprintf(stderr, "%s: %s\n", cur->fts_name, mac_error(error)); + mac_free(label); goto label_out; } - + mac_free(label); +label_out: if (labelstr == NULL) labelstr = strdup(""); - -label_out: labelstrlen = strlen(labelstr); if (labelstrlen > maxlabelstr) maxlabelstr = labelstrlen; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message