Gilles Chehade said: > without commenting on the need for the utility itself, the code you have > provided does not respect the coding style of OpenBSD, and your main > function shouldn't be returning errno
Sorry, I was not paying enough attention to style. What about this one: ======================================================================== unlink.c ======================================================================== /* * Copyright (c) 2014 Dmitrij D. Czarkoff <czark...@gmail.com> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include <errno.h> #include <locale.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> extern char *__progname; static void usage(void); int main(int argc, char **argv) { setlocale(LC_ALL, ""); if (argc != 2) usage(); else if (unlink(*(argv + 1))) { perror(__progname); return (1); } return (0); } static void usage(void) { (void)fprintf(stderr, "usage: %s file\n", __progname); exit(1); } ======================================================================== -- Dmitrij D. Czarkoff