@@ -1355,6 +1355,11 @@ fio_sync(char const* path, fio_location location)
1355
1355
}
1356
1356
}
1357
1357
1358
+ enum {
1359
+ GET_CRC32_DECOMPRESS = 1 ,
1360
+ GET_CRC32_MISSING_OK = 2
1361
+ };
1362
+
1358
1363
/* Get crc32 of file */
1359
1364
pg_crc32
1360
1365
fio_get_crc32 (const char * file_path , fio_location location ,
@@ -1371,9 +1376,9 @@ fio_get_crc32(const char *file_path, fio_location location,
1371
1376
hdr .arg = 0 ;
1372
1377
1373
1378
if (decompress )
1374
- hdr .arg = 1 ;
1379
+ hdr .arg = GET_CRC32_DECOMPRESS ;
1375
1380
if (missing_ok )
1376
- hdr .arg |= 2 ;
1381
+ hdr .arg |= GET_CRC32_MISSING_OK ;
1377
1382
1378
1383
IO_CHECK (fio_write_all (fio_stdout , & hdr , sizeof (hdr )), sizeof (hdr ));
1379
1384
IO_CHECK (fio_write_all (fio_stdout , file_path , path_len ), path_len );
@@ -3383,10 +3388,10 @@ fio_communicate(int in, int out)
3383
3388
break ;
3384
3389
case FIO_GET_CRC32 :
3385
3390
/* calculate crc32 for a file */
3386
- if ((hdr .arg & 1 ))
3387
- crc = pgFileGetCRCgz (buf , true, (hdr .arg & 2 ) != 0 );
3391
+ if ((hdr .arg & GET_CRC32_DECOMPRESS ))
3392
+ crc = pgFileGetCRCgz (buf , true, (hdr .arg & GET_CRC32_MISSING_OK ) != 0 );
3388
3393
else
3389
- crc = pgFileGetCRC (buf , true, (hdr .arg & 2 ) != 0 );
3394
+ crc = pgFileGetCRC (buf , true, (hdr .arg & GET_CRC32_MISSING_OK ) != 0 );
3390
3395
IO_CHECK (fio_write_all (out , & crc , sizeof (crc )), sizeof (crc ));
3391
3396
break ;
3392
3397
case FIO_GET_CHECKSUM_MAP :
0 commit comments