X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=apps%2Fpndnotifyd.c;h=c4882571eed123ba580d61d62394f15d5dd5b8b8;hb=d1dd0db0d1b5149a08a005762e04d4aef2240493;hp=fd1c1a11e475cd5b7399f644206dd0992bffaaee;hpb=8290d9ca651c95ff7f5108b7019987162293287c;p=pandora-libraries.git diff --git a/apps/pndnotifyd.c b/apps/pndnotifyd.c index fd1c1a1..c488257 100644 --- a/apps/pndnotifyd.c +++ b/apps/pndnotifyd.c @@ -73,6 +73,7 @@ unsigned char g_info_p = 0; // spit out info .desktops // constants #define PNDNOTIFYD_LOGLEVEL "pndnotifyd.loglevel" +#define PNDLOCKNAME "pndnotifyd-disco.lock" // decl's void consume_configuration ( void ); @@ -315,6 +316,13 @@ int main ( int argc, char *argv[] ) { /* run the discovery */ + // do some 'locking' + pnd_log ( pndn_rem, "creating lockfile %s", PNDLOCKNAME ); + if ( ! pnd_lock ( PNDLOCKNAME ) ) { + // problem .. well, too bad, we need to do this .. proceed! + } + + // scan.. pnd_log ( pndn_rem, " Scanning desktop paths----------------------------\n" ); if ( ! perform_discoveries ( desktop_appspath, overridespath, desktop_dotdesktoppath, desktop_iconpath ) ) { pnd_log ( pndn_rem, " No applications found in desktop search path\n" ); @@ -327,6 +335,10 @@ int main ( int argc, char *argv[] ) { } } + // unlock + pnd_log ( pndn_rem, "clearing lockfile %s", PNDLOCKNAME ); + pnd_unlock ( PNDLOCKNAME ); + // if we've got a hup script located, lets invoke it if ( pndhup ) { pnd_log ( pndn_rem, "Invoking hup script '%s'.\n", pndhup ); @@ -742,13 +754,16 @@ void process_discoveries ( pnd_box_handle applist, char *emitdesktoppath, char * // info .desktop if ( g_info_p && info_dotdesktoppath ) { - if ( pnd_emit_dotinfo ( info_dotdesktoppath, pndrun, d ) ) { - // nada - } else { + if ( ! pnd_emit_dotinfo ( info_dotdesktoppath, pndrun, d ) ) { pnd_log ( pndn_rem, "ERROR: Error creating info .desktop file for app: %s\n", pnd_box_get_key ( d ) ); } } + // file association requests + if ( ! pnd_emit_dotassoc ( info_dotdesktoppath, pndrun, d ) ) { + pnd_log ( pndn_rem, "ERROR: Error creating file association .desktop file for app: %s\n", pnd_box_get_key ( d ) ); + } + // does this object request any mkdir's? if ( d -> mkdir_sp ) {