// lets not eat up all the CPU
// should use an alarm or select() or something -- I mean really, why aren't I putting interval_secs into
// the select() call above in pnd_notify_whatsitcalled()? -- but lets not break this right before release shall we
+ // NOTE: Oh right, I remember now -- inotify will spam when a card is inserted, and it will not be instantaneoous..
+ // the events will dribble in over a second. So this sleep is a lame trick that generally works. I really should
+ // do select(), and then when it returns just spin for a couple seconds slurping up events until no more and a thresh-hold
+ // time is hit, but this will do for now. I suck.
sleep ( interval_secs );
} // while
// attempt to auto-discover applications in the given path
applist = pnd_disco_search ( appspath, overridespath );
- if ( ! applist ) {
- return ( 0 );
+ if ( applist ) {
+ process_discoveries ( applist, emitdesktoppath, emiticonpath );
}
- process_discoveries ( applist, emitdesktoppath, emiticonpath );
-
// run a clean up, to remove any dotdesktop files that we didn't
// just now create (that seem to have been created by pndnotifyd
// previously.) This allows SD eject (or .pnd remove) to remove
*/
unsigned char pnd_notify_rediscover_p ( pnd_notify_handle h );
+/* wait_until_ready() will loop (up to a max of secs_timeout) until inotify seems to
+ * be responding. Returns 0 if inotify is never ready during the interval, otherwise
+ * it suggests inotify is up and going.
+ * secs_timeout may be 0 which means 'forever'
+ */
+unsigned char pnd_notify_wait_until_ready ( unsigned int secs_timeout );
+
#ifdef __cplusplus
} /* "C" */
#endif
return ( 1 );
}
+
+/* we've run into the issue where inotify returns that it is set up, but in
+ * fact is not doing anything; restarting the process repairs it.. so here
+ * we devise a wank that continually tests inotify until it responds, then
+ * returns knowing we're good
+ */
+unsigned char pnd_notify_wait_until_ready ( unsigned int secs_timeout ) {
+ return ( 0 ); // fail
+}
+
+static unsigned char _inotify_test_run ( void ) {
+#if 0
+ // set up inotify
+ int fd;
+
+ fd = inotify_init();
+
+ if ( fd < 0 ) {
+ return ( 0 ); // failed to init at all
+ }
+
+
+
+#endif
+}