Date: Sun, 29 Sep 2002 20:31:08 -0700 (PDT) From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 18354 for review Message-ID: <200209300331.g8U3V8uI092145@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200209300331.g8U3V8uI092145>