Skip to content

Commit

Permalink
Merge pull request #54 from woshizhy/master
Browse files Browse the repository at this point in the history
Supports renaming files on MTP Responder side
  • Loading branch information
jfdelnero committed Dec 30, 2020
2 parents 34446bd + aec48cd commit 846678e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/inotify.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ void* inotify_thread(void* arg)
// Sanity check to prevent possible buffer overrun/overflow.
if ( event->len && (i + (( sizeof (struct inotify_event) ) + event->len) < sizeof(inotify_buffer)) )
{
if ( event->mask & IN_CREATE )
if ( event->mask & IN_CREATE || event->mask & IN_MOVED_TO )
{
entry = NULL;
do
Expand Down Expand Up @@ -212,7 +212,7 @@ void* inotify_thread(void* arg)
}while(entry);
}

if ( event->mask & IN_DELETE )
if ( event->mask & IN_CREATE || event->mask & IN_MOVED_FROM )
{
entry = NULL;

Expand Down Expand Up @@ -310,7 +310,7 @@ int inotify_handler_addwatch( mtp_ctx * ctx, char * path )
{
if( !ctx->no_inotify )
{
return inotify_add_watch( ctx->inotify_fd, path, IN_CREATE | IN_DELETE | IN_MODIFY );
return inotify_add_watch( ctx->inotify_fd, path, IN_CREATE | IN_DELETE | IN_MODIFY | IN_MOVED_FROM | IN_MOVED_TO );
}
}

Expand Down

0 comments on commit 846678e

Please sign in to comment.