Files
apfstests/src/rename.c
T
Christoph Hellwig c96afe9caa test 196, add a testcase for renames across project boundaries
Make sure rename across project boundaries is rejected and doesn't
cause hangs.  Based on a report and testcase from Arkadiusz Miskiewicz.

Signed-off-by: Christoph Hellwig <hch@lst.de>
2008-12-31 12:53:33 +01:00

22 lines
320 B
C

/*
* A trivial shell command wrapping rename(2).
*/
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
if (argc != 3) {
fprintf(stderr, "usage: rename <from> <to>\n");
exit(EXIT_FAILURE);
}
if (rename(argv[1], argv[2]) == -1) {
perror("rename");
exit(EXIT_FAILURE);
}
exit(0);
}