@@ -3206,37 +3206,43 @@ local_check_postmaster(const char *pgdata)
32063206 * and check that process is running, if process is running, return its pid number.
32073207 */
32083208pid_t
3209- fio_check_postmaster (const char * pgdata , fio_location location )
3209+ fio_check_postmaster (fio_location location , const char * pgdata )
32103210{
32113211 if (fio_is_remote (location ))
32123212 {
3213- fio_header hdr ;
3214-
3215- hdr .cop = FIO_CHECK_POSTMASTER ;
3216- hdr .size = strlen (pgdata ) + 1 ;
3213+ fio_header hdr = {
3214+ .cop = FIO_CHECK_POSTMASTER ,
3215+ .handle = -1 ,
3216+ .size = strlen (pgdata ) + 1 ,
3217+ .arg = 0 ,
3218+ };
32173219
32183220 IO_CHECK (fio_write_all (fio_stdout , & hdr , sizeof (hdr )), sizeof (hdr ));
32193221 IO_CHECK (fio_write_all (fio_stdout , pgdata , hdr .size ), hdr .size );
32203222
32213223 /* receive result */
32223224 IO_CHECK (fio_read_all (fio_stdin , & hdr , sizeof (hdr )), sizeof (hdr ));
3225+ Assert (hdr .cop == FIO_CHECK_POSTMASTER );
3226+
32233227 return hdr .arg ;
32243228 }
32253229 else
32263230 return local_check_postmaster (pgdata );
32273231}
32283232
32293233static void
3230- fio_check_postmaster_impl (int out , char * buf )
3234+ fio_check_postmaster_impl (const char * pgdata , int out )
32313235{
3232- fio_header hdr ;
3233- pid_t postmaster_pid ;
3234- char * pgdata = (char * ) buf ;
3236+ fio_header hdr = {
3237+ .cop = FIO_CHECK_POSTMASTER ,
3238+ .handle = -1 ,
3239+ .size = 0 ,
3240+ .arg = 0 ,
3241+ };
32353242
3236- postmaster_pid = local_check_postmaster (pgdata );
3243+ hdr . arg = local_check_postmaster (pgdata );
32373244
32383245 /* send arrays of checksums to main process */
3239- hdr .arg = postmaster_pid ;
32403246 IO_CHECK (fio_write_all (out , & hdr , sizeof (hdr )), sizeof (hdr ));
32413247}
32423248
@@ -3427,8 +3433,7 @@ fio_communicate(int in, int out)
34273433 fio_get_lsn_map_impl (out , buf );
34283434 break ;
34293435 case FIO_CHECK_POSTMASTER :
3430- /* calculate crc32 for a file */
3431- fio_check_postmaster_impl (out , buf );
3436+ fio_check_postmaster_impl (buf , out );
34323437 break ;
34333438 case FIO_DISCONNECT :
34343439 hdr .cop = FIO_DISCONNECTED ;
0 commit comments