// constants
#define PNDNOTIFYD_LOGLEVEL "pndnotifyd.loglevel"
+#define PNDLOCKNAME "pndnotifyd-disco.lock"
// decl's
void consume_configuration ( void );
/* 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" );
}
}
+ // 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 );
// 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 ) {