MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / write_bucket

Function write_bucket

src/msgs/build_file.cpp:447–478  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

445
446
447static SLONG write_bucket(const msgnod* bucket, USHORT length)
448{
449/**************************************
450 *
451 * w r i t e _ b u c k e t
452 *
453 **************************************
454 *
455 * Functional description
456 * Write stuff, return position of stuff written.
457 *
458 **************************************/
459 const USHORT padded_length = ROUNDUP(length, sizeof(SLONG));
460 const SLONG position = global_file_position;
461 int n = write(global_file, bucket, length);
462 if (n == -1)
463 {
464 fprintf(stderr, "IO error on write()\n");
465 exit(FINI_ERROR);
466 }
467
468 const SLONG zero_bytes = 0;
469 n = write(global_file, &zero_bytes, padded_length - length);
470 if (n == -1)
471 {
472 fprintf(stderr, "IO error on write()\n");
473 exit(FINI_ERROR);
474 }
475 global_file_position += padded_length;
476
477 return position;
478}

Callers 2

do_msgsFunction · 0.85
propagateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected