1570af302Sopenharmony_ci#include <stdio.h> 2570af302Sopenharmony_ci#include <errno.h> 3570af302Sopenharmony_ci#include <fcntl.h> 4570af302Sopenharmony_ci#include <unistd.h> 5570af302Sopenharmony_ci 6570af302Sopenharmony_ciint remove(const char *path) 7570af302Sopenharmony_ci{ 8570af302Sopenharmony_ci int r = unlink(path); 9570af302Sopenharmony_ci if (r==-EISDIR) r = rmdir(path); 10570af302Sopenharmony_ci return r; 11570af302Sopenharmony_ci} 12