forked from enlightenment/efl
1. let us not install eeze_scanner in e17's utils dir. really not nice
to do that. 2. just use regular ecore-con naming of the socket. it will handle if someone else has it. no need to do tmpdir and filename stuff by hand. SVN revision: 74261
This commit is contained in:
parent
1ab16d192b
commit
e174bc3c99
|
@ -17,7 +17,7 @@ endif
|
||||||
|
|
||||||
bin_PROGRAMS = $(DISK_PROGS)
|
bin_PROGRAMS = $(DISK_PROGS)
|
||||||
util_PROGRAMS = $(SCAN_PROGS)
|
util_PROGRAMS = $(SCAN_PROGS)
|
||||||
utildir = @libdir@/enlightenment/utils
|
utildir = $(bindir)
|
||||||
|
|
||||||
eeze_udev_test_SOURCES = eeze_udev_test.c
|
eeze_udev_test_SOURCES = eeze_udev_test.c
|
||||||
eeze_udev_test_CPPFLAGS = -I$(top_srcdir)/src/lib @EEZE_CFLAGS@
|
eeze_udev_test_CPPFLAGS = -I$(top_srcdir)/src/lib @EEZE_CFLAGS@
|
||||||
|
@ -44,6 +44,6 @@ if HAVE_EEZE_MOUNT
|
||||||
|
|
||||||
setuid_root_mode = a=rx,u+xs
|
setuid_root_mode = a=rx,u+xs
|
||||||
install-data-hook:
|
install-data-hook:
|
||||||
@chmod $(setuid_root_mode) $(DESTDIR)$(libdir)/enlightenment/utils/eeze_scanner$(EXEEXT) || true
|
@chmod $(setuid_root_mode) $(DESTDIR)$(bindir)/eeze_scanner$(EXEEXT) || true
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -386,17 +386,7 @@ cb_stor_chg(const char *device, Eeze_Udev_Event ev, void *data __UNUSED__, Eeze_
|
||||||
static void
|
static void
|
||||||
es_exit(int sig)
|
es_exit(int sig)
|
||||||
{
|
{
|
||||||
const char *tmp;
|
|
||||||
char buf[1024];
|
|
||||||
struct stat st;
|
|
||||||
ecore_con_server_del(svr);
|
ecore_con_server_del(svr);
|
||||||
|
|
||||||
tmp = getenv("TMPDIR");
|
|
||||||
if (!tmp) tmp = "/tmp";
|
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%s/.ecore_service|eeze_scanner|0", tmp);
|
|
||||||
if (!stat(buf, &st))
|
|
||||||
unlink(buf);
|
|
||||||
exit(sig);
|
exit(sig);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -422,10 +412,6 @@ sigs_setup(void)
|
||||||
int
|
int
|
||||||
main(void)
|
main(void)
|
||||||
{
|
{
|
||||||
const char *tmp;
|
|
||||||
char buf[128], buf2[128];
|
|
||||||
struct stat st;
|
|
||||||
|
|
||||||
eina_init();
|
eina_init();
|
||||||
ecore_init();
|
ecore_init();
|
||||||
ecore_con_init();
|
ecore_con_init();
|
||||||
|
@ -436,16 +422,6 @@ main(void)
|
||||||
sigs_setup();
|
sigs_setup();
|
||||||
es_log_dom = eina_log_domain_register("eeze_scanner", EINA_COLOR_CYAN);
|
es_log_dom = eina_log_domain_register("eeze_scanner", EINA_COLOR_CYAN);
|
||||||
|
|
||||||
tmp = getenv("TMPDIR");
|
|
||||||
if (!tmp) tmp = "/tmp";
|
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%s/.ecore_service|eeze_scanner", tmp);
|
|
||||||
snprintf(buf2, sizeof(buf), "%s/.ecore_service|eeze_scanner|0", tmp);
|
|
||||||
if (!stat(buf2, &st))
|
|
||||||
{
|
|
||||||
ERR("Socket file '%s' for scanner already exists! Refusing to start up!", buf2);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
eet_setup();
|
eet_setup();
|
||||||
clients = eina_hash_pointer_new(NULL);
|
clients = eina_hash_pointer_new(NULL);
|
||||||
EINA_SAFETY_ON_NULL_GOTO(clients, error);
|
EINA_SAFETY_ON_NULL_GOTO(clients, error);
|
||||||
|
@ -460,13 +436,8 @@ main(void)
|
||||||
eeze_udev_watch_add(EEZE_UDEV_TYPE_DRIVE_CDROM, EEZE_UDEV_EVENT_NONE, cb_stor_chg, NULL);
|
eeze_udev_watch_add(EEZE_UDEV_TYPE_DRIVE_CDROM, EEZE_UDEV_EVENT_NONE, cb_stor_chg, NULL);
|
||||||
eeze_udev_watch_add(EEZE_UDEV_TYPE_DRIVE_MOUNTABLE, EEZE_UDEV_EVENT_NONE, cb_vol_chg, NULL);
|
eeze_udev_watch_add(EEZE_UDEV_TYPE_DRIVE_MOUNTABLE, EEZE_UDEV_EVENT_NONE, cb_vol_chg, NULL);
|
||||||
|
|
||||||
svr = ecore_con_server_add(ECORE_CON_LOCAL_SYSTEM, buf, 0, NULL);
|
svr = ecore_con_server_add(ECORE_CON_LOCAL_SYSTEM, "eeze_scanner", 0, NULL);
|
||||||
EINA_SAFETY_ON_NULL_GOTO(svr, error);
|
EINA_SAFETY_ON_NULL_GOTO(svr, error);
|
||||||
if (chmod(buf2, S_IRWXU | S_IRWXG | S_IRWXO))
|
|
||||||
{
|
|
||||||
ERR("Could not chmod socket (%s)! \"%s\"", buf, strerror(errno));
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
storage_setup();
|
storage_setup();
|
||||||
ecore_main_loop_begin();
|
ecore_main_loop_begin();
|
||||||
|
|
Loading…
Reference in New Issue