File: getfsdev.c

package info (click to toggle)
rsync 3.2.7-1%2Bdeb12u4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 6,220 kB
  • sloc: ansic: 43,621; sh: 6,256; python: 1,621; asm: 829; perl: 550; makefile: 367; cpp: 298; awk: 191
file content (22 lines) | stat: -rw-r--r-- 374 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "rsync.h"

 int main(int argc, char *argv[])
{
	STRUCT_STAT st;
	int ret;

	while (--argc > 0) {
#ifdef USE_STAT64_FUNCS
		ret = stat64(*++argv, &st);
#else
		ret = stat(*++argv, &st);
#endif
		if (ret < 0) {
			fprintf(stderr, "Unable to stat `%s'\n", *argv);
			exit(1);
		}
		printf("%ld/%ld\n", (long)major(st.st_dev), (long)minor(st.st_dev));
	}

	return 0;
}