{
error (0, errno, _("failed to create temporary file"));
taint_set_taint (ctf->taint);
{
error (0, errno, _("failed to create temporary file"));
taint_set_taint (ctf->taint);
otherwise tainted, false otherwise. */
static bool
do_seek (const struct case_tmpfile *ctf_,
otherwise tainted, false otherwise. */
static bool
do_seek (const struct case_tmpfile *ctf_,
{
off_t value_ofs = value_idx + (off_t) ctf->value_cnt * case_idx;
off_t byte_ofs = sizeof (union value) * value_ofs;
{
off_t value_ofs = value_idx + (off_t) ctf->value_cnt * case_idx;
off_t byte_ofs = sizeof (union value) * value_ofs;
Returns true if successful, false upon an I/O error (in which
case CTF is marked tainted). */
static bool
Returns true if successful, false upon an I/O error (in which
case CTF is marked tainted). */
static bool
{
assert (!case_tmpfile_error (ctf));
if (fwrite (buffer, bytes, 1, ctf->file) != 1)
{
{
assert (!case_tmpfile_error (ctf));
if (fwrite (buffer, bytes, 1, ctf->file) != 1)
{
bool
case_tmpfile_get_values (const struct case_tmpfile *ctf,
casenumber case_idx, size_t start_value,
bool
case_tmpfile_get_values (const struct case_tmpfile *ctf,
casenumber case_idx, size_t start_value,
from CTF had not previously been written. */
bool
case_tmpfile_get_case (const struct case_tmpfile *ctf, casenumber case_idx,
from CTF had not previously been written. */
bool
case_tmpfile_get_case (const struct case_tmpfile *ctf, casenumber case_idx,
{
case_create (c, ctf->value_cnt);
if (case_tmpfile_get_values (ctf, case_idx, 0,
{
case_create (c, ctf->value_cnt);
if (case_tmpfile_get_values (ctf, case_idx, 0,
return (do_seek (ctf, case_idx, start_value)
&& do_write (ctf, sizeof *values * value_cnt, values));
return (do_seek (ctf, case_idx, start_value)
&& do_write (ctf, sizeof *values * value_cnt, values));
/* Writes C to CTF as the case numbered CASE_IDX.
Returns true if successful, false if CTF is tainted or an I/O
error occurs during the operation. */
bool
case_tmpfile_put_case (struct case_tmpfile *ctf, casenumber case_idx,
/* Writes C to CTF as the case numbered CASE_IDX.
Returns true if successful, false if CTF is tainted or an I/O
error occurs during the operation. */
bool
case_tmpfile_put_case (struct case_tmpfile *ctf, casenumber case_idx,
{
bool ok = case_tmpfile_put_values (ctf, case_idx, 0,
case_data_all (c), ctf->value_cnt);
{
bool ok = case_tmpfile_put_values (ctf, case_idx, 0,
case_data_all (c), ctf->value_cnt);