bad_link

bad_link - static void link_empty2(void int rv...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/* * link */ #include <unistd.h> #include <errno.h> #include "test.h" static void link_dir(void) { int rv; rv = link(".", TESTDIR); report_test(rv, errno, EINVAL, "hard link of ."); if (rv==0) { /* this might help recover. .. maybe */ remove(TESTDIR); } } static void link_empty1(void) { int rv; rv = link("", TESTDIR); report_test(rv, errno, EINVAL, "hard link of empty string");
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } static void link_empty2(void) { int rv; if (create_testdir()<0) { return; } rv = link(TESTDIR, ""); report_test(rv, errno, EINVAL, "hard link to empty string"); rmdir(TESTDIR); } void test_link(void) { test_link_paths(); link_dir(); link_empty1(); link_empty2(); }...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online