@@ -3658,33 +3658,39 @@ fio_check_postmaster(fio_location location, const char *pgdata)
36583658{
36593659 if (fio_is_remote (location ))
36603660 {
3661- fio_header hdr ;
3662-
3663- hdr .cop = FIO_CHECK_POSTMASTER ;
3664- hdr .size = strlen (pgdata ) + 1 ;
3661+ fio_header hdr = {
3662+ .cop = FIO_CHECK_POSTMASTER ,
3663+ .handle = -1 ,
3664+ .size = strlen (pgdata ) + 1 ,
3665+ .arg = 0 ,
3666+ };
36653667
36663668 IO_CHECK (fio_write_all (fio_stdout , & hdr , sizeof (hdr )), sizeof (hdr ));
36673669 IO_CHECK (fio_write_all (fio_stdout , pgdata , hdr .size ), hdr .size );
36683670
36693671 /* receive result */
36703672 IO_CHECK (fio_read_all (fio_stdin , & hdr , sizeof (hdr )), sizeof (hdr ));
3673+ Assert (hdr .cop == FIO_CHECK_POSTMASTER );
3674+
36713675 return hdr .arg ;
36723676 }
36733677 else
36743678 return local_check_postmaster (pgdata );
36753679}
36763680
36773681static void
3678- fio_check_postmaster_impl (int out , char * buf )
3682+ fio_check_postmaster_impl (const char * pgdata , int out )
36793683{
3680- fio_header hdr ;
3681- pid_t postmaster_pid ;
3682- char * pgdata = (char * ) buf ;
3684+ fio_header hdr = {
3685+ .cop = FIO_CHECK_POSTMASTER ,
3686+ .handle = -1 ,
3687+ .size = 0 ,
3688+ .arg = 0 ,
3689+ };
36833690
3684- postmaster_pid = local_check_postmaster (pgdata );
3691+ hdr . arg = local_check_postmaster (pgdata );
36853692
36863693 /* send arrays of checksums to main process */
3687- hdr .arg = postmaster_pid ;
36883694 IO_CHECK (fio_write_all (out , & hdr , sizeof (hdr )), sizeof (hdr ));
36893695}
36903696
@@ -3881,8 +3887,7 @@ fio_communicate(int in, int out)
38813887 fio_get_lsn_map_impl (out , buf );
38823888 break ;
38833889 case FIO_CHECK_POSTMASTER :
3884- /* calculate crc32 for a file */
3885- fio_check_postmaster_impl (out , buf );
3890+ fio_check_postmaster_impl (buf , out );
38863891 break ;
38873892 case FIO_DISCONNECT :
38883893 hdr .cop = FIO_DISCONNECTED ;
0 commit comments