Ignore:
Timestamp:
Jul 12, 2011, 11:52:39 AM (14 years ago)
Author:
bird
Message:

kmkbuiltins: More specific error messages (solaris EINTR).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/kmkbuiltin/ln.c

    r2129 r2466  
    155155                 */
    156156                errno = ENOTDIR;
    157                 return err(1, "%s", sourcedir);
     157                return err(1, "st_mode: %s", sourcedir);
    158158        }
    159159        if (stat(sourcedir, &sb))
    160                 return err(1, "%s", sourcedir);
     160                return err(1, "stat: %s", sourcedir);
    161161        if (!S_ISDIR(sb.st_mode))
    162162                return usage(stderr);
     
    177177                /* If target doesn't exist, quit now. */
    178178                if (stat(target, &sb)) {
    179                         warn("%s", target);
     179                        warn("stat: %s", target);
    180180                        return (1);
    181181                }
     
    183183                if (S_ISDIR(sb.st_mode)) {
    184184                        errno = EISDIR;
    185                         warn("%s", target);
     185                        warn("st_mode: %s", target);
    186186                        return (1);
    187187                }
     
    210210                    (ssize_t)sizeof(path)) {
    211211                        errno = ENAMETOOLONG;
    212                         warn("%s", target);
     212                        warn("snprintf: %s", target);
    213213                        return (1);
    214214                }
     
    223223        if (fflag && exists) {
    224224                if (unlink(source)) {
    225                         warn("%s", source);
     225                        warn("unlink: %s", source);
    226226                        return (1);
    227227                }
     
    239239
    240240                if (unlink(source)) {
    241                         warn("%s", source);
     241                        warn("unlink: %s", source);
    242242                        return (1);
    243243                }
     
    246246        /* Attempt the link. */
    247247        if ((*linkf)(target, source)) {
    248                 warn("%s", source);
     248                warn("%s: %s", linkf == link ? "link" : "symlink", source);
    249249                return (1);
    250250        }
Note: See TracChangeset for help on using the changeset viewer.