File: sccutils.h

package info (click to toggle)
z8530-utils2 3.0-1-7
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 252 kB
  • ctags: 113
  • sloc: ansic: 1,217; makefile: 94; sh: 6
file content (24 lines) | stat: -rw-r--r-- 484 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#define PROCFILE "/proc/net/z8530drv"
#define CONFIGFILE "/etc/z8530drv.conf"

#define VERSION "z8530drv-3.0\n"

static inline void check_version(void)
{
	FILE *fp = fopen(PROCFILE,"r");
	char buf[1024];
	
	if (fp == NULL)
	{
		fprintf(stderr,"sccinit: Warning, is z8530drv really loaded?\n");
		return;
	}

	fgets(buf, sizeof(buf), fp);
	if (strcmp(buf, VERSION))
	{
		fprintf(stderr,"sccinit: Warning, this program is for "
			VERSION", the driver is %s\n", buf);
	}
	fclose(fp);
}