bad_rmdir

bad_rmdir - } static void rmdir_dotdot(void) { int rv; rv =...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
/* * rmdir */ #include <sys/types.h> #include <sys/stat.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <errno.h> #include <err.h> #include "config.h" #include "test.h" static void rmdir_file(void) { int rv; if (create_testfile()<0) { return; } rv = rmdir(TESTFILE); report_test(rv, errno, ENOTDIR, "rmdir a file"); remove(TESTFILE); } static void rmdir_dot(void) { int rv; rv = rmdir("."); report_test(rv, errno, EINVAL, "rmdir .");
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } static void rmdir_dotdot(void) { int rv; rv = rmdir(&quot;. .&quot;); report_test2(rv, errno, EINVAL, ENOTEMPTY, &quot;rmdir . .&quot;); } static void rmdir_empty(void) { int rv; rv = rmdir(&quot;&quot;); report_test(rv, errno, EINVAL, &quot;rmdir empty string&quot;); } void test_rmdir(void) { test_rmdir_path(); rmdir_file(); rmdir_dot(); rmdir_dotdot(); rmdir_empty(); }...
View Full Document

This note was uploaded on 11/10/2009 for the course CS 536 taught by Professor Lums during the Spring '09 term at Indiana.

Page1 / 2

bad_rmdir - } static void rmdir_dotdot(void) { int rv; rv =...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online