Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 30 lines (25 sloc) 0.522 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>

static int usage()
{
    fprintf(stderr,"rmdir <directory>\n");
    return -1;
}

int rmdir_main(int argc, char *argv[])
{
    int symbolic = 0;
    int ret;
    if(argc < 2) return usage();

    while(argc > 1) {
        argc--;
        argv++;
        ret = rmdir(argv[0]);
        if(ret < 0) {
            fprintf(stderr, "rmdir failed for %s, %s\n", argv[0], strerror(errno));
            return ret;
        }
    }
    
    return 0;
}
Something went wrong with that request. Please try again.