Hi there,

creat(3) "is made obsolete by: open(2)". The diff below replaces one
occurrence of

creat(path, mode)

with

open(path, O_CREAT | O_TRUNC | O_WRONLY, mode)

in libutil.

Cheers,
Frederic


Index: lib/libutil/uucplock.c
===================================================================
RCS file: /cvs/src/lib/libutil/uucplock.c,v
retrieving revision 1.16
diff -u -p -r1.16 uucplock.c
--- uucplock.c  27 Oct 2009 23:59:30 -0000      1.16
+++ uucplock.c  10 Nov 2015 19:34:39 -0000
@@ -70,7 +70,7 @@ uu_lock(const char *ttyname)
            (long)pid);
        (void)snprintf(lckname, sizeof(lckname), _PATH_UUCPLOCK LOCKFMT,
            ttyname);
-       if ((tmpfd = creat(lcktmpname, 0664)) < 0)
+       if ((tmpfd = open(lcktmpname, O_CREAT | O_TRUNC | O_WRONLY, 0664)) < 0)
                GORET(0, UU_LOCK_CREAT_ERR);

        for (i = 0; i < MAXTRIES; i++) {

Reply via email to