/* 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 );
pnd_log ( pndn_rem, "perform discovery - apps: %s, overrides: %s\n", appspath, overridespath );
pnd_log ( pndn_rem, " - emit desktop: %s, icons: %s\n", emitdesktoppath, emiticonpath );
- // 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!
- }
-
// attempt to auto-discover applications in the given path
applist = pnd_disco_search ( appspath, overridespath );
pnd_box_delete ( applist ); // does not free the disco_t contents!
}
- // close the lock
- pnd_log ( pndn_rem, "clearing lockfile %s", PNDLOCKNAME );
- pnd_unlock ( PNDLOCKNAME );
-
return ( 1 );
}
snprintf ( fullpath, PATH_MAX, "%s/%s", PND_LOCK_PATH, lockname );
- if ( ( fd = creat ( fullpath, 0400 ) < 0 ) ) {
+ if ( ( fd = creat ( fullpath, 0444 ) < 0 ) ) {
return ( 0 ); // error, yeah, I know, no way to know why it failed..
}
// making sure the file is at least a few seconds old, to help avoid race condition
struct stat statbuf;
- if ( stat ( ovrfile, &statbuf ) == 0 && time ( NULL ) - statbuf.st_mtime > 5 ) { // race with pndnotifyd
+ // *** commented out this stat() 'race test' since it buggers up icon loading at boot, if using .desktop instead of .pnd scanning..
+ if ( stat ( ovrfile, &statbuf ) == 0 /*&& time ( NULL ) - statbuf.st_mtime > 5*/ ) { // race with pndnotifyd
buflen = statbuf.st_size;
if ( ( iconbuf = malloc ( statbuf.st_size ) ) ) {
int fd = open ( ovrfile, O_RDONLY );