Update semaphonewrite.c