@@ -255,7 +255,7 @@ static int copy_to_sideband(int in, int out, void *arg)
255255typedef int (* feed_fn )(void * , const char * * , size_t * );
256256static int run_and_feed_hook (const char * hook_name , feed_fn feed , void * feed_state )
257257{
258- struct child_process proc ;
258+ struct child_process proc = CHILD_PROCESS_INIT ;
259259 struct async muxer ;
260260 const char * argv [2 ];
261261 int code ;
@@ -266,7 +266,6 @@ static int run_and_feed_hook(const char *hook_name, feed_fn feed, void *feed_sta
266266
267267 argv [1 ] = NULL ;
268268
269- memset (& proc , 0 , sizeof (proc ));
270269 proc .argv = argv ;
271270 proc .in = -1 ;
272271 proc .stdout_to_stderr = 1 ;
@@ -350,7 +349,7 @@ static int run_receive_hook(struct command *commands, const char *hook_name,
350349static int run_update_hook (struct command * cmd )
351350{
352351 const char * argv [5 ];
353- struct child_process proc ;
352+ struct child_process proc = CHILD_PROCESS_INIT ;
354353 int code ;
355354
356355 argv [0 ] = find_hook ("update" );
@@ -362,7 +361,6 @@ static int run_update_hook(struct command *cmd)
362361 argv [3 ] = sha1_to_hex (cmd -> new_sha1 );
363362 argv [4 ] = NULL ;
364363
365- memset (& proc , 0 , sizeof (proc ));
366364 proc .no_stdin = 1 ;
367365 proc .stdout_to_stderr = 1 ;
368366 proc .err = use_sideband ? -1 : 0 ;
@@ -598,7 +596,7 @@ static void run_update_post_hook(struct command *commands)
598596 struct command * cmd ;
599597 int argc ;
600598 const char * * argv ;
601- struct child_process proc ;
599+ struct child_process proc = CHILD_PROCESS_INIT ;
602600 char * hook ;
603601
604602 hook = find_hook ("post-update" );
@@ -621,7 +619,6 @@ static void run_update_post_hook(struct command *commands)
621619 }
622620 argv [argc ] = NULL ;
623621
624- memset (& proc , 0 , sizeof (proc ));
625622 proc .no_stdin = 1 ;
626623 proc .stdout_to_stderr = 1 ;
627624 proc .err = use_sideband ? -1 : 0 ;
@@ -911,7 +908,7 @@ static const char *unpack(int err_fd, struct shallow_info *si)
911908 const char * hdr_err ;
912909 int status ;
913910 char hdr_arg [38 ];
914- struct child_process child ;
911+ struct child_process child = CHILD_PROCESS_INIT ;
915912 int fsck_objects = (receive_fsck_objects >= 0
916913 ? receive_fsck_objects
917914 : transfer_fsck_objects >= 0
@@ -933,7 +930,6 @@ static const char *unpack(int err_fd, struct shallow_info *si)
933930 argv_array_pushl (& av , "--shallow-file" , alt_shallow_file , NULL );
934931 }
935932
936- memset (& child , 0 , sizeof (child ));
937933 if (ntohl (hdr .hdr_entries ) < unpack_limit ) {
938934 argv_array_pushl (& av , "unpack-objects" , hdr_arg , NULL );
939935 if (quiet )
0 commit comments