View | Details | Raw Unified
Collapse All | Expand All

(-) server/gam_inotify.c (-8 / +18 lines)
 Lines 168-177    Link Here 
	    GAM_DEBUG(DEBUG_INFO, "Removing %s from inotify\n", path);
	    GAM_DEBUG(DEBUG_INFO, "Removing %s from inotify\n", path);
	    break;
	    break;
	case GAMIN_FLOWCONTROLSTART:
	case GAMIN_FLOWCONTROLSTART:
	    GAM_DEBUG(DEBUG_INFO, "Start flow control for %s\n", path);
	    GAM_DEBUG(DEBUG_INFO, "inotify: Start flow control for %s\n", path);
	    break;
	    break;
	case GAMIN_FLOWCONTROLSTOP:
	case GAMIN_FLOWCONTROLSTOP:
	    GAM_DEBUG(DEBUG_INFO, "Stop flow control for %s\n", path);
	    GAM_DEBUG(DEBUG_INFO, "inotify: Stop flow control for %s\n", path);
	    break;
	    break;
	default:
	default:
	    gam_error(DEBUG_INFO, "Unknown inotify operation %d for %s\n",
	    gam_error(DEBUG_INFO, "Unknown inotify operation %d for %s\n",
 Lines 281-288    Link Here 
            }
            }
            GAM_DEBUG(DEBUG_INFO, "  not found using parent\n");
            GAM_DEBUG(DEBUG_INFO, "  not found using parent\n");
        }
        }
#if 0
        if (data != NULL) {
        if (data != NULL) {
	    if (mode == GAMIN_FLOWCONTROLSTART) {
	    if (mode == GAMIN_FLOWCONTROLSTART) {
		GAM_DEBUG(DEBUG_INFO, "inotify: GAMIN_FLOWCONTROLSTART for %s\n", data->path);
		if (data->wd >= 0) {
		if (data->wd >= 0) {
		    if (ioctl (inotify_device_fd, INOTIFY_IGNORE, &data->wd) < 0) {
		    if (ioctl (inotify_device_fd, INOTIFY_IGNORE, &data->wd) < 0) {
			GAM_DEBUG (DEBUG_INFO, "INOTIFY_IGNORE failed for %s (wd = %d)\n", data->path, data->wd);
			GAM_DEBUG (DEBUG_INFO, "INOTIFY_IGNORE failed for %s (wd = %d)\n", data->path, data->wd);
 Lines 296-309    Link Here 
		}
		}
		data->busy++;
		data->busy++;
	    } else {
	    } else {
		GAM_DEBUG(DEBUG_INFO, "inotify: GAMIN_FLOWCONTROLSTOP for %s\n", data->path);
	        if (data->busy > 0) {
	        if (data->busy > 0) {
		    GAM_DEBUG(DEBUG_INFO, "inotify: data->busy > 0 for %s\n", data->path);
		    data->busy--;
		    data->busy--;
		    if (data->busy == 0) {
		    if (data->busy == 0) {
			GAM_DEBUG(DEBUG_INFO, "inotify: data->busy == 0 for %s\n", data->path);
			path_fd = open(data->path, O_RDONLY);
			path_fd = open(data->path, O_RDONLY);
			if (path_fd < 0) {
			if (path_fd < 0) {
			    G_UNLOCK(inotify);
			    G_UNLOCK(inotify);
			    GAM_DEBUG(DEBUG_INFO,
			    GAM_DEBUG(DEBUG_INFO,
			              "Failed to reactivate inotify for %s\n",
			              "failed to reactivate inotify for %s\n",
				      data->path);
				      data->path);
                            if ((dir != path) && (dir != NULL))
                            if ((dir != path) && (dir != NULL))
 Lines 317-323    Link Here 
			close (path_fd);
			close (path_fd);
			/* Remove the old wd from the hash table */
			/* Remove the old wd from the hash table */
		    g_hash_table_remove(wd_hash, GINT_TO_POINTER(data->wd));
			g_hash_table_remove(wd_hash, GINT_TO_POINTER(data->wd));
			data->wd = path_wd;
			data->wd = path_wd;
			data->deactivated = FALSE;
			data->deactivated = FALSE;
 Lines 325-331    Link Here 
			/* Insert the new wd into the hash table */
			/* Insert the new wd into the hash table */
			g_hash_table_insert(wd_hash, GINT_TO_POINTER(data->wd),
			g_hash_table_insert(wd_hash, GINT_TO_POINTER(data->wd),
			                    data);
			                    data);
			GAM_DEBUG(DEBUG_INFO, "Reactivated inotify for %s\n",
			GAM_DEBUG(DEBUG_INFO, "reactivated inotify for %s\n",
			          data->path);
			          data->path);
#ifdef GAMIN_DEBUG_API
#ifdef GAMIN_DEBUG_API
			gam_debug_report(GAMinotifyFlowOff, path, 0);
			gam_debug_report(GAMinotifyFlowOff, path, 0);
 Lines 334-339    Link Here 
		}
		}
	    }
	    }
	}
	}
#endif
        if ((dir != path) && (dir != NULL))
        if ((dir != path) && (dir != NULL))
            g_free(dir);
            g_free(dir);
    } else {
    } else {
 Lines 420-431    Link Here 
	data = g_hash_table_lookup (wd_hash, GINT_TO_POINTER(event->wd));
	data = g_hash_table_lookup (wd_hash, GINT_TO_POINTER(event->wd));
	if (!data) {
	if (!data) {
	    GAM_DEBUG(DEBUG_INFO, "inotify can't find wd %d\n", event->wd);
	    GAM_DEBUG(DEBUG_INFO, "processing event: inotify can't find wd %d\n", event->wd);
	} else if (data->deactivated) {
	    GAM_DEBUG(DEBUG_INFO, "inotify: ignoring event on temporarily deactivated watch %s\n", data->path);
	} else {
	} else {
	    if (event->mask == IN_IGNORED) {
	    if (event->mask == IN_IGNORED) {
		GList *l;
		GList *l;
		GAM_DEBUG(DEBUG_INFO, "inotify ignoring wd %d\n", event->wd);
		GAM_DEBUG(DEBUG_INFO, "inotify: IN_IGNORE on wd=%d\n", event->wd);
		GAM_DEBUG(DEBUG_INFO, "inotify: removing all subscriptions for %s\n", data->path);
		l = data->subs;
		l = data->subs;
		data->subs = NULL;
		data->subs = NULL;
 Lines 441-447    Link Here 
		    gam_poll_scan_directory (data->path);
		    gam_poll_scan_directory (data->path);
		}
		}
	    } else if (event->mask == IN_Q_OVERFLOW) {
	    } else if (event->mask == IN_Q_OVERFLOW) {
		GAM_DEBUG(DEBUG_INFO, "inotify queue over flowed\n");
		    GAM_DEBUG(DEBUG_INFO, "inotify queue over flowed\n");
		    GAM_DEBUG(DEBUG_INFO, "FIXME, should request poll for all paths here\n");
	    }
	    }
	}
	}
(-) server/gam_server.c (+2 lines)
 Lines 99-104    Link Here 
	if (gam_inotify_init()) {
	if (gam_inotify_init()) {
	    GAM_DEBUG(DEBUG_INFO, "Using INotify as backend\n");
	    GAM_DEBUG(DEBUG_INFO, "Using INotify as backend\n");
	    return(TRUE);
	    return(TRUE);
	} else {
		printf("Not using inotify backend\n");
	}
	}
#endif
#endif
#ifdef ENABLE_DNOTIFY
#ifdef ENABLE_DNOTIFY