Lines 2165-2171
Link Here
|
2165 |
if (fam_connection == NULL) { |
2165 |
if (fam_connection == NULL) { |
2166 |
fam_connection = g_malloc0(sizeof(FAMConnection)); |
2166 |
fam_connection = g_malloc0(sizeof(FAMConnection)); |
2167 |
if (FAMOpen2(fam_connection, "test-monitor") != 0) { |
2167 |
if (FAMOpen2(fam_connection, "test-monitor") != 0) { |
2168 |
g_print ("FAMOpen failed, FAMErrno=%d\n", FAMErrno); |
2168 |
/* Throttle error message propagation. Without this step |
|
|
2169 |
* logfiles would bomb each machine within short time. |
2170 |
* Code is kind of bloaty. Users hate it getting bombed out |
2171 |
* of their machines. |
2172 |
*/ |
2173 |
static time_t last_message = 0; |
2174 |
static int last_error = 0; |
2175 |
int current_error = FAMErrno; |
2176 |
|
2177 |
if (time() - last_message > 180 || |
2178 |
current_error != last_error) |
2179 |
{ |
2180 |
last_message = time(); |
2181 |
last_error = current_error; |
2182 |
|
2183 |
g_print ("FAMOpen failed, FAMErrno=%d\n" |
2184 |
"This indicates a problem with the " |
2185 |
"File Alteration Monitor (FAM).\n" |
2186 |
"Make sure that FAM is installed " |
2187 |
"properly and lauched on startup.\n", |
2188 |
current_error); |
2189 |
} |
2190 |
|
2169 |
g_free(fam_connection); |
2191 |
g_free(fam_connection); |
2170 |
fam_connection = NULL; |
2192 |
fam_connection = NULL; |
2171 |
G_UNLOCK (fam_connection); |
2193 |
G_UNLOCK (fam_connection); |