X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;ds=sidebyside;f=tests%2Flib%2Fcommon.c;fp=tests%2Flib%2Fcommon.c;h=0000000000000000000000000000000000000000;hb=550b7a4e67a46d1de6b3e83b010b6d38b1c5e7d4;hp=1878d777d3eba4b78f43523a4dcc8f48fd8719a0;hpb=c88dd1cb8e4858f962f417943983cb39c1a2c245;p=babeltrace.git diff --git a/tests/lib/common.c b/tests/lib/common.c deleted file mode 100644 index 1878d777..00000000 --- a/tests/lib/common.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - * common.c - * - * Lib BabelTrace - Common function to all tests - * - * Copyright 2012 - Yannick Brosseau - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; under version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include -#include -#include -#include - -#define RMDIR_NFDOPEN 8 - -static -int nftw_recursive_rmdir(const char *file, const struct stat *sb, int flag, - struct FTW *s) -{ - switch (flag) { - case FTW_F: - unlink(file); - break; - case FTW_DP: - rmdir(file); - break; - } - - return 0; -} - -void recursive_rmdir(const char *path) -{ - int nftw_flags = FTW_PHYS | FTW_DEPTH; - - nftw(path, nftw_recursive_rmdir, RMDIR_NFDOPEN, nftw_flags); -}