Changeset c3db721 in mainline for uspace/lib/fmgt/src/fmgt.c


Ignore:
Timestamp:
2025-10-10T20:35:05Z (2 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
c1383cd
Parents:
0cf3d5f
Message:

Allow aborting file management operation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/fmgt/src/fmgt.c

    r0cf3d5f rc3db721  
    221221}
    222222
     223/** Query caller whether operation should be aborted.
     224 *
     225 * @param fmgt File management object
     226 * @return @c true iff operation should be aborted
     227 */
     228static bool fmgt_abort_query(fmgt_t *fmgt)
     229{
     230        if (fmgt->cb != NULL && fmgt->cb->abort_query!= NULL)
     231                return fmgt->cb->abort_query(fmgt->cb_arg);
     232        else
     233                return false;
     234}
     235
    223236/** Create new file.
    224237 *
     
    276289
    277290                fmgt->curf_procb += nw;
     291
     292                /* User requested abort? */
     293                if (fmgt_abort_query(fmgt)) {
     294                        free(buffer);
     295                        vfs_put(fd);
     296                        fmgt_final_progress_update(fmgt);
     297                        return EINTR;
     298                }
    278299        }
    279300
Note: See TracChangeset for help on using the changeset viewer.