1/*
2 * Copyright 2006, ASUSTek Inc.
3 * All Rights Reserved.
4 *
5 * THIS SOFTWARE IS OFFERED "AS IS", AND ASUS GRANTS NO WARRANTIES OF ANY
6 * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
7 * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
8 * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
9 *
10 * $Id: dosfsde.c,v 1.1.1.1 2008/10/15 03:28:48 james26_jang Exp $
11 */
12#ifdef USB_SUPPORT
13#include <stdio.h>
14#include <signal.h>
15#include <time.h>
16#include <sys/time.h>
17#include <unistd.h>
18#include <stdlib.h>
19#include <sys/types.h>
20
21#include <bcmnvram.h>
22#include <shutils.h>
23#include <rc.h>
24#include <stdarg.h>
25
26static void catch_sig(int sig)
27{
28	if (sig == SIGUSR1)
29	{
30		//printf("SIGUSR1 catched\n");
31	}
32}
33
34int dosfsde_main(void)
35{
36	pid_t pid;
37	FILE *fp;
38	int ret;
39
40	fp=fopen("/var/run/dosfsde.pid","w");
41	if (fp==NULL) exit(0);
42	fprintf(fp, "%d", getpid());
43	fclose(fp);
44
45	signal(SIGUSR1, catch_sig);
46
47	while(1)
48	{
49		usb_disk_detect(nvram_safe_get("usb_disk_detect"));
50		pause();
51	}
52}
53#endif
54
55