Annotation of researchv10no/cmd/asd/opendir.c, revision 1.1.1.1

1.1       root        1: /* Copyright (c) 1982 Regents of the University of California */
                      2: 
                      3: #include "config.h"
                      4: #ifdef LOCALDIR
                      5: #include <sys/types.h>
                      6: #include <sys/stat.h>
                      7: #include "ndir.h"
                      8: 
                      9: static char sccsid[] = "@(#)opendir.c 4.2 3/10/82";
                     10: 
                     11: /*
                     12:  * open a directory.
                     13:  */
                     14: DIR *
                     15: opendir(name)
                     16:        char *name;
                     17: {
                     18:        register DIR *dirp;
                     19: 
                     20:        dirp = (DIR *)malloc(sizeof(DIR));
                     21:        dirp->dd_fd = open(name, 0);
                     22:        if (dirp->dd_fd == -1) {
                     23:                free(dirp);
                     24:                return NULL;
                     25:        }
                     26:        dirp->dd_loc = 0;
                     27:        return dirp;
                     28: }
                     29: #endif

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.