X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Funix.c;h=380966055b57a92ca196d619429b4fbf4400b732;hb=30be9a32fd26a2d08aa4413942408500c93ad4a3;hp=73bd7c56f21303ae9924654daec85d679238dea6;hpb=377e50914cd78d52e77032a3eaf8972f23b4e7b9;p=yaz-moved-to-github.git diff --git a/src/unix.c b/src/unix.c index 73bd7c5..3809660 100644 --- a/src/unix.c +++ b/src/unix.c @@ -1,9 +1,6 @@ -/* - * Copyright (C) 1995-2007, Index Data ApS +/* This file is part of the YAZ toolkit. + * Copyright (C) 1995-2009 Index Data * See the file LICENSE for details. - * - * $Id: unix.c,v 1.20 2007-10-09 06:00:56 adam Exp $ - * UNIX socket COMSTACK. By Morten Bøgeskov. */ /** * \file unix.c @@ -428,8 +425,16 @@ static int unix_bind(COMSTACK h, void *address, int mode) h->cerrno = CSYSERR; return -1; } - chown(path, sp->uid, sp->gid); - chmod(path, sp->umask != -1 ? sp->umask : 0666); + if (chown(path, sp->uid, sp->gid)) + { + h->cerrno = CSYSERR; + return -1; + } + if (chmod(path, sp->umask != -1 ? sp->umask : 0666)) + { + h->cerrno = CSYSERR; + return -1; + } if (mode == CS_SERVER && listen(h->iofile, 100) < 0) { h->cerrno = CSYSERR; @@ -740,6 +745,7 @@ static int unix_set_blocking(COMSTACK p, int flags) /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab