Author | Jamozed <[email protected]> |
Date | 2020-07-06 10:46:57 |
Commit | c6fc8c9a81736e36f26b79436c1b63c8886b432f |
Parent | ee7158012a05bbc508a355030c726bc9201b7d82 |
logname: Use libokv error reporting
Diffstat
M | src/logname.c | | | 10 | ++++------ |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/logname.c b/src/logname.c index ed4f2cb..9ddfeba 100644 --- a/src/logname.c +++ b/src/logname.c @@ -1,4 +1,4 @@ -// logname.c, version 1.0.0 +// logname.c, version 1.0.1 // OMKOV coreutils implementation of POSIX logname // Copyright (C) 2020, Jakob Wakeling // All rights reserved. @@ -17,17 +17,15 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. */ -#include "error.h" +#include <error.h> #include <unistd.h> -#include <errno.h> #include <stdio.h> -#include <string.h> -int main(int argc, char *argv[]) { (void)argc; +int main(int ac, char *av[]) { (void)ac; register char *login = getlogin(); - if (!login) { error(1, "%s: %s", argv[0], serrno); } + if (!login) { error(1, "%s", serr()); } else { fputs(login, stdout); fputc('\n', stdout); } return 0; }