1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-18 13:54:36 -05:00

Only cache successful run. (Thanks to Koppa nd daemoni)

This commit is contained in:
Qball Cow 2015-09-29 17:27:47 +02:00
parent 29360b20aa
commit 9b67838b56
3 changed files with 23 additions and 18 deletions

View file

@ -21,3 +21,5 @@ Tilman Blumenbach
qedi
seanpringle
vimeitor
koppa
daemoni

View file

@ -45,8 +45,9 @@
#define RUN_CACHE_FILE "rofi-2.runcache"
static inline void execsh ( const char *cmd, int run_in_term )
static inline int execsh ( const char *cmd, int run_in_term )
{
int retv = TRUE;
char **args = NULL;
int argc = 0;
if ( run_in_term ) {
@ -63,10 +64,12 @@ static inline void execsh ( const char *cmd, int run_in_term )
g_free ( msg );
// print error.
g_error_free ( error );
retv = FALSE;
}
// Free the args list.
g_strfreev ( args );
return retv;
}
// execute sub-process
@ -76,8 +79,7 @@ static void exec_cmd ( const char *cmd, int run_in_term )
return;
}
execsh ( cmd, run_in_term );
if ( execsh ( cmd, run_in_term ) ) {
/**
* This happens in non-critical time (After launching app)
* It is allowed to be a bit slower.
@ -88,6 +90,7 @@ static void exec_cmd ( const char *cmd, int run_in_term )
g_free ( path );
}
}
// execute sub-process
static void delete_entry ( const char *cmd )
{