mirror of
https://github.com/octoleo/lsyncd.git
synced 2024-12-13 14:43:09 +00:00
+ fixing 0 characters in -log Exec message for pipes
This commit is contained in:
parent
25a2274d83
commit
6290bd6ea7
@ -199,12 +199,6 @@ rsync.action = function( inlet )
|
||||
delete = { '--delete', '--ignore-errors' }
|
||||
end
|
||||
|
||||
log(
|
||||
'Normal',
|
||||
'Computed',
|
||||
config.rsync._computed
|
||||
)
|
||||
|
||||
spawn(
|
||||
elist,
|
||||
config.rsync.binary,
|
||||
|
18
lsyncd.c
18
lsyncd.c
@ -560,7 +560,7 @@ pipe_writey(
|
||||
}
|
||||
else if( pm->pos >= pm->tlen )
|
||||
{
|
||||
logstring("Exec", "finished pipe.");
|
||||
logstring( "Exec", "finished pipe." );
|
||||
nonobserve_fd(fd);
|
||||
}
|
||||
}
|
||||
@ -1116,17 +1116,29 @@ l_exec( lua_State *L )
|
||||
for( i = 1; i <= argc; i++ )
|
||||
{
|
||||
lua_pushstring( L, " [" );
|
||||
lua_pushvalue( L, i + 1 );
|
||||
lua_pushvalue( L, i + 1 );
|
||||
lua_pushstring( L, "]" );
|
||||
}
|
||||
|
||||
lua_concat( L, 3 * argc + 1 );
|
||||
|
||||
// replaces midfile 0 chars by linefeed
|
||||
size_t len = 0;
|
||||
const char * cs = lua_tolstring( L, -1, &len );
|
||||
char * s = s_calloc( len + 1, sizeof( char ) );
|
||||
|
||||
for( i = 0; i < len; i++ )
|
||||
{
|
||||
s[ i ] = cs[ i ] ? cs[ i ] : '\n';
|
||||
}
|
||||
|
||||
logstring0(
|
||||
LOG_DEBUG, "Exec",
|
||||
luaL_checkstring(L, -1)
|
||||
s
|
||||
);
|
||||
|
||||
free( s );
|
||||
|
||||
lua_pop( L, 1 );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user