iosm.c File Reference
PAYLOAD.

File state machine to handle a payload from a package. More...

`#include "system.h"`
`#include <rpmio_internal.h>`
`#include <rpmcb.h>`
`#include <ugid.h>`
`#include <rpmsq.h>`
`#include <rpmsw.h>`
`#include "../rpmdb/rpmtag.h"`
`#include <iosm.h>`
`#include "cpio.h"`
`#include "tar.h"`
`#include "ar.h"`
`#include "../lib/rpmfi.h"`
`#include "debug.h"`
Include dependency graph for iosm.c:

Go to the source code of this file.

## Data Structures

struct | dnli_s
| Directory name iterator. More...

## Macros

#define | _IOSM_INTERNAL
#define | iosmUNSAFE iosmStage
#define | _RPMFI_INTERNAL
#define | _RPMFI_NOMETHODS
#define | alloca_strdup(_s) strcpy(alloca(strlen(_s)+1), (_s))
#define | _IOSM_DEBUG 0
#define | SUFFIX_RPMORIG ".rpmorig"
#define | SUFFIX_RPMSAVE ".rpmsave"
#define | SUFFIX_RPMNEW ".rpmnew"
#define | IS_DEV_LOG(_x)
#define | _fafilter(_a)
#define | IOSM_SKIPPING(_a) ((_a) == FA_SKIP || (_a) == FA_SKIPNSTATE || (_a) == FA_SKIPNETSHARED || (_a) == FA_SKIPCOLOR)

## Typedefs

typedef struct rpmts_s * | rpmts
typedef struct rpmte_s * | rpmte
typedef iosmMapFlags | cpioMapFlags
typedef struct rpmds_s * | rpmds
typedef struct rpmRelocation_s * | rpmRelocation
typedef struct rpmdb_s * | rpmdb
typedef struct rpmmi_s * | rpmmi
typedef struct rpmPRCO_s * | rpmPRCO
typedef struct Spec_s * | Spec
typedef struct dnli_s * | DNLI_t
| Directory name iterator. More...

## Functions

void * | iosmGetFi (const IOSM_t iosm)
static const char * | iosmFsPath (const IOSM_t iosm, const struct stat *st, const char *subdir, const char *suffix)
| Build path to file from file info, ornamented with subdir and suffix. More...
static void * | mapFreeIterator (void *p)
| Destroy file info iterator. More...
static void * | mapInitIterator (rpmfi fi, int reverse)
| Create file info iterator. More...
static int | mapNextIterator (void *a)
| Return next index into file info. More...
static int | iosmStrCmp (const void *a, const void *b)
static int | mapFind (IOSMI_t iter, const char *iosmPath)
| Locate archive path in file info. More...
static void * | dnlFreeIterator (const void *a)
| Destroy directory name iterator. More...
static int | dnlCount (const DNLI_t dnli)
static int | dnlIndex (const DNLI_t dnli)
static void * | dnlInitIterator (const IOSM_t iosm, int reverse)
| Create directory name iterator. More...
static const char * | dnlNextIterator (DNLI_t dnli)
| Return next directory name (from file info). More...
int | iosmNext (IOSM_t iosm, iosmFileStage nstage)
| File state machine driver. More...
static int | saveHardLink (IOSM_t iosm)
| Save hard link in chain. More...
static void * | freeHardLink (struct hardLink_s *li)
| Destroy set of hard links. More...
IOSM_t | newIOSM (void)
IOSM_t | freeIOSM (IOSM_t iosm)
static int | arSetup (IOSM_t iosm, rpmfi fi)
int | iosmSetup (IOSM_t iosm, iosmFileStage goal, const char *afmt, const void *_ts, const void *_fi, FD_t cfd, unsigned int *archiveSize, const char **failedFile)
| Load external data into I/O state machine. More...
int | iosmTeardown (IOSM_t iosm)
| Clean I/O state machine. More...
static int | iosmMapFContext (IOSM_t iosm)
int | iosmMapPath (IOSM_t iosm)
int | iosmMapAttrs (IOSM_t iosm)
static int | extractRegular (IOSM_t iosm)
| Create file from payload stream. More...
static int | writeFile (IOSM_t iosm, int writeData)
| Write next item to payload stream. More...
static int | writeLinkedFile (IOSM_t iosm)
| Write set of linked files to payload stream. More...
static int | iosmMakeLinks (IOSM_t iosm)
| Create pending hard links to existing file. More...
static int | iosmCommitLinks (IOSM_t iosm)
| Commit hard linked file set atomically. More...
static int | iosmRmdirs (IOSM_t iosm)
| Remove (if created) directories not explicitly included in package. More...
static int | iosmMkdirs (IOSM_t iosm)
| Create (if necessary) directories not explicitly included in package. More...
int | iosmStage (IOSM_t iosm, iosmFileStage stage)
| File state machine driver. More...
int | iosmFileActionSkipped (iosmFileAction action)
| Is the file going to be skipped? More...
const char * | iosmFileActionString (iosmFileAction a)
| Return formatted string representation of file disposition. More...
const char * | iosmFileStageString (iosmFileStage a)
| Return formatted string representation of file stages. More...
char * | iosmStrerror (int rc)
| Return formatted error message on payload handling failure. More...

## Variables

int | _iosm_debug = 0
int | _iosm_threads = 0
int(* | _iosmNext )(IOSM_t iosm, iosmFileStage nstage) = &iosmNext

## Detailed Description

File state machine to handle a payload from a package.

Definition in file iosm.c.

## Macro Definition Documentation

#define _fafilter | ( |  | _a | ) |

Value:
(!((_a) == FA_CREATE || (_a) == FA_ERASE || (_a) == FA_COPYIN || (_a) == FA_COPYOUT) \
? iosmFileActionString(_a) : "")

#define _IOSM_DEBUG 0

Definition at line 65 of file iosm.c.

#define _IOSM_INTERNAL

Definition at line 20 of file iosm.c.

#define _RPMFI_INTERNAL

Definition at line 29 of file iosm.c.

#define _RPMFI_NOMETHODS

Definition at line 30 of file iosm.c.

#define alloca_strdup | ( |  | _s | ) | strcpy(alloca(strlen(_s)+1), (_s))

Definition at line 63 of file iosm.c.

#define IOSM_SKIPPING | ( |  | _a | ) | ((_a) == FA_SKIP || (_a) == FA_SKIPNSTATE || (_a) == FA_SKIPNETSHARED || (_a) == FA_SKIPCOLOR)

Definition at line 2675 of file iosm.c.

Referenced by iosmFileActionSkipped().

#define iosmUNSAFE iosmStage

Definition at line 22 of file iosm.c.

Referenced by iosmMakeLinks(), iosmMkdirs(), iosmSetup(), iosmStage(), iosmTeardown(), and writeFile().

#define IS_DEV_LOG | ( |  | _x | ) |

Value:
((_x) != NULL && strlen(_x) >= (sizeof("/dev/log")-1) && \
!strncmp((_x), "/dev/log", sizeof("/dev/log")-1) && \
((_x)[sizeof("/dev/log")-1] == '\0' || \
(_x)[sizeof("/dev/log")-1] == ';'))

Definition at line 1641 of file iosm.c.

Referenced by iosmStage().

#define SUFFIX_RPMNEW ".rpmnew"

Definition at line 99 of file iosm.c.

Referenced by iosmMapPath().

#define SUFFIX_RPMORIG ".rpmorig"

Definition at line 97 of file iosm.c.

Referenced by iosmMapPath().

#define SUFFIX_RPMSAVE ".rpmsave"

Definition at line 98 of file iosm.c.

Referenced by iosmMapPath().

## Typedef Documentation

typedef iosmMapFlags cpioMapFlags

Definition at line 28 of file iosm.c.

typedef struct rpmdb_s* rpmdb

Definition at line 46 of file iosm.c.

typedef struct rpmds_s* rpmds

Definition at line 33 of file iosm.c.

typedef struct rpmmi_s* rpmmi

Definition at line 47 of file iosm.c.

typedef struct rpmPRCO_s* rpmPRCO

Definition at line 48 of file iosm.c.

typedef struct rpmRelocation_s* rpmRelocation

Definition at line 34 of file iosm.c.

typedef struct rpmte_s* rpmte

Definition at line 18 of file iosm.c.

typedef struct rpmts_s* rpmts

Definition at line 17 of file iosm.c.

typedef struct Spec_s* Spec

Definition at line 49 of file iosm.c.

## Function Documentation

static int arSetup | ( | IOSM_t | iosm,
|  | rpmfi | fi
| ) |  |

static

Definition at line 587 of file iosm.c.

References rpmfiBN(), rpmfiInit(), rpmfiNext(), stpcpy(), urlPath(), and xmalloc().

Referenced by fsmSetup(), and iosmSetup().

static int dnlCount | ( | const DNLI_t | dnli | ) |

inline static

Definition at line 297 of file iosm.c.

References dnli_s::fi.

Referenced by iosmMkdirs(), and iosmRmdirs().

static void* dnlFreeIterator | ( | const void * | a | ) |

static

Destroy directory name iterator.

Parameters

  a | directory name iterator

Return values

  NULL | always

Definition at line 285 of file iosm.c.

References _free(), and dnli_s::active.

Referenced by iosmMkdirs(), and iosmRmdirs().

static int dnlIndex | ( | const DNLI_t | dnli | ) |

inline static

Definition at line 305 of file iosm.c.

References dnli_s::isave.

Referenced by iosmMkdirs(), and iosmRmdirs().

static void* dnlInitIterator | ( | const IOSM_t | iosm,
|  | int | reverse
| ) |  |

static

Create directory name iterator.

Parameters

  iosm | file state machine data
  reverse | traverse directory names in reverse order?

Returns
  directory name iterator

Definition at line 319 of file iosm.c.

References dnli_s::active, D_, dnli_s::fi, dnli_s::i, iosmFileActionSkipped(), iosmGetFi(), reverse, dnli_s::reverse, rpmfiInit(), rpmfiNext(), rpmlog(), RPMLOG_DEBUG, urlPath(), and xcalloc().

Referenced by iosmMkdirs(), and iosmRmdirs().

static const char* dnlNextIterator | ( | DNLI_t | dnli | ) |

static

Return next directory name (from file info).

Parameters

  dnli | directory name iterator

Returns
  next directory name

Definition at line 417 of file iosm.c.

References dnli_s::active, dnli_s::fi, dnli_s::i, dnli_s::isave, and dnli_s::reverse.

Referenced by iosmMkdirs(), and iosmRmdirs().

static int extractRegular | ( | IOSM_t | iosm | ) |

static

Create file from payload stream.

Parameters

  iosm | file state machine data

Returns
  0 on success

Definition at line 1035 of file iosm.c.

References _free(), fdFiniDigest(), fdInitDigest(), Fflush(), Fileno(), IOSM_DREAD, IOSM_NOTIFY, IOSM_WCLOSE, IOSM_WOPEN, IOSM_WRITE, and iosmNext().

Referenced by iosmStage().

static void* freeHardLink | ( | struct hardLink_s * | li | ) |

static

Destroy set of hard links.

Parameters

  li | set of hard links

Returns
  NULL always

Definition at line 555 of file iosm.c.

References _free().

Referenced by freeIOSM(), and iosmStage().

IOSM_t freeIOSM | ( | IOSM_t | iosm | ) |

Definition at line 571 of file iosm.c.

References _free(), freeHardLink(), and mapFreeIterator().

int iosmFileActionSkipped | ( | iosmFileAction | action | ) |

Is the file going to be skipped?

Parameters

  iosm | I/O state machine

Returns
  Is file to be skipped?

Definition at line 2678 of file iosm.c.

References IOSM_SKIPPING.

Referenced by dnlInitIterator(), fsmCommitLinks(), fsmMakeLinks(), fsmStage(), handleInstInstalledFiles(), handleOverlappedFiles(), iosmCommitLinks(), iosmMakeLinks(), iosmStage(), rpmtsRun(), saveHardLink(), and skipFiles().

const char* iosmFileActionString | ( | iosmFileAction | a | ) |

Return formatted string representation of file disposition.

Parameters

  a | file dispostion

Returns
  formatted string

Definition at line 2683 of file iosm.c.

References FA_ALTNAME, FA_BACKUP, FA_COPYIN, FA_COPYOUT, FA_CREATE, FA_ERASE, FA_SAVE, FA_SKIP, FA_SKIPCOLOR, FA_SKIPNETSHARED, FA_SKIPNSTATE, and FA_UNKNOWN.

const char* iosmFileStageString | ( | iosmFileStage | a | ) |

Return formatted string representation of file stages.

Parameters

  a | file stage

Returns
  formatted string

Definition at line 2703 of file iosm.c.

References IOSM_CHMOD, IOSM_CHOWN, IOSM_CHROOT, IOSM_COMMIT, IOSM_CREATE, IOSM_DESTROY, IOSM_DREAD, IOSM_DWRITE, IOSM_EAT, IOSM_FINI, IOSM_HREAD, IOSM_HWRITE, IOSM_INIT, IOSM_LCHOWN, IOSM_LINK, IOSM_LSETFCON, IOSM_LSTAT, IOSM_MAP, IOSM_MKDIR, IOSM_MKDIRS, IOSM_MKFIFO, IOSM_MKLINKS, IOSM_MKNOD, IOSM_NEXT, IOSM_NOTIFY, IOSM_PAD, IOSM_PKGBUILD, IOSM_PKGCOMMIT, IOSM_PKGERASE, IOSM_PKGINSTALL, IOSM_PKGUNDO, IOSM_POS, IOSM_POST, IOSM_PRE, IOSM_PROCESS, IOSM_RCLOSE, IOSM_READ, IOSM_READLINK, IOSM_RENAME, IOSM_RMDIR, IOSM_RMDIRS, IOSM_ROPEN, IOSM_STAT, IOSM_SYMLINK, IOSM_TRAILER, IOSM_UNDO, IOSM_UNKNOWN, IOSM_UNLINK, IOSM_UTIME, IOSM_VERIFY, IOSM_WCLOSE, IOSM_WOPEN, and IOSM_WRITE.

Referenced by fsmStage(), and iosmStage().

void* iosmGetFi | ( | const IOSM_t | iosm | ) |

Definition at line 89 of file iosm.c.

Referenced by dnlInitIterator(), iosmMapAttrs(), iosmMapFContext(), iosmMapPath(), iosmMkdirs(), iosmStage(), saveHardLink(), and writeFile().

int iosmMapAttrs | ( | IOSM_t | iosm | ) |

Definition at line 946 of file iosm.c.

References _, gnameToGid(), IOSM_MAP_GID, IOSM_MAP_MODE, IOSM_MAP_TYPE, IOSM_MAP_UID, IOSM_PKGINSTALL, iosmGetFi(), rpmlog(), RPMLOG_WARNING, and unameToUid().

Referenced by iosmStage().

static int iosmMapFContext | ( | IOSM_t | iosm | ) |

static

Definition at line 826 of file iosm.c.

References iosmGetFi(), and matchpathcon.

Referenced by iosmStage().

int iosmMapPath | ( | IOSM_t | iosm | ) |

Definition at line 855 of file iosm.c.

References _free(), FA_ALTNAME, FA_BACKUP, FA_COPYIN, FA_COPYOUT, FA_CREATE, FA_ERASE, FA_SAVE, FA_SKIP, FA_SKIPCOLOR, FA_SKIPNETSHARED, FA_SKIPNSTATE, FA_UNKNOWN, IOSM_MAP_PATH, iosmFsPath(), iosmGetFi(), RPMFILE_GHOST, RPMFILE_STATE_NETSHARED, RPMFILE_STATE_NOTINSTALLED, RPMFILE_STATE_WRONGCOLOR, rpmteType(), SUFFIX_RPMNEW, SUFFIX_RPMORIG, SUFFIX_RPMSAVE, and TR_REMOVED.

Referenced by iosmStage().

static int iosmMkdirs | ( | IOSM_t | iosm | ) |

static

Create (if necessary) directories not explicitly included in package.

Parameters

  iosm | file state machine data

Returns
  0 on success

Definition at line 1476 of file iosm.c.

References _free(), D_, dc, dnlCount(), dnlFreeIterator(), dnlIndex(), dnlInitIterator(), dnlNextIterator(), IOSM_LSETFCON, IOSM_LSTAT, IOSM_MKDIR, iosmGetFi(), iosmNext(), iosmUNSAFE, matchpathcon, rpmlog(), RPMLOG_DEBUG, stpcpy(), urlPath(), xcalloc(), and xrealloc().

Referenced by iosmStage().

int iosmNext | ( | IOSM_t | iosm,
|  | iosmFileStage | nstage
| ) |  |

File state machine driver.

Parameters

  iosm | I/O state machine
  nstage | next stage

Returns
  0 on success

Definition at line 452 of file iosm.c.

References iosmStage(), rpmsqJoin(), and rpmsqThread().

Referenced by extractRegular(), iosmCommitLinks(), iosmMakeLinks(), iosmMkdirs(), iosmRmdirs(), iosmSetup(), iosmStage(), saveHardLink(), writeFile(), and writeLinkedFile().

static int iosmRmdirs | ( | IOSM_t | iosm | ) |

static

Remove (if created) directories not explicitly included in package.

Parameters

  iosm | file state machine data

Returns
  0 on success

Definition at line 1421 of file iosm.c.

References dc, dnlCount(), dnlFreeIterator(), dnlIndex(), dnlInitIterator(), dnlNextIterator(), IOSM_RMDIR, iosmNext(), and stpcpy().

Referenced by iosmStage().

int iosmSetup | ( | IOSM_t | iosm,
|  | iosmFileStage | goal,
|  | const char * | afmt,
|  | const void * | _ts,
|  | const void * | _fi,
|  | FD_t | cfd,
|  | unsigned int * | archiveSize,
|  | const char ** | failedFile
| ) |  |

Load external data into I/O state machine.

Parameters

  iosm | I/O state machine
  goal |
  afmt | archive format (NULL uses cpio)
  _ts | transaction set
  _fi | transaction element file info
  cfd | payload descriptor

Return values

  archiveSize | pointer to archive size
  failedFile | pointer to first file name that failed.

Returns
  0 on success

Definition at line 660 of file iosm.c.

References _iosm_debug, _iosm_threads, _iosmNext, _tsmask, arHeaderRead(), arHeaderWrite(), arSetup(), arTrailerWrite(), cpioHeaderRead(), cpioHeaderWrite(), cpioTrailerWrite(), FA_COPYOUT, fdGetCpioPos(), fdLink(), fdSetCpioPos(), IOSM_CREATE, IOSM_PKGBUILD, IOSM_PKGCOMMIT, IOSM_PKGERASE, IOSM_PKGINSTALL, iosmNext(), iosmUNSAFE, mapInitIterator(), reverse, RPMCALLBACK_INST_START, rpmteType(), RPMTRANS_FLAG_NOCONTEXTS, RPMTRANS_FLAG_NOFDIGESTS, rpmtsFlags(), rpmtsGetTid(), rpmtsLink(), rpmtsNotify(), TAR_BLOCK_SIZE, tarHeaderRead(), tarHeaderWrite(), tarTrailerWrite(), TR_ADDED, and TR_REMOVED.

int iosmStage | ( | IOSM_t | iosm,
|  | iosmFileStage | stage
| ) |  |

File state machine driver.

Parameters

  iosm | I/O state machine
  stage | next stage

Returns
  0 on success

Definition at line 1648 of file iosm.c.

References _, _fafilter, _free(), alloca(), Chmod(), Chown(), CPIO_TRAILER, errno, extractRegular(), FA_ERASE, FA_UNKNOWN, Fclose(), fdGetCpioPos(), fdSetCpioPos(), FDSTAT_DIGEST, fdstat_op(), Ferror(), Fopen(), Fread(), freeHardLink(), Fwrite(), IOSM_ALL_HARDLINKS, IOSM_CHMOD, IOSM_CHOWN, IOSM_CHROOT, IOSM_COMMIT, IOSM_CREATE, IOSM_DEAD, IOSM_DESTROY, IOSM_DREAD, IOSM_DWRITE, IOSM_EAT, IOSM_FINI, IOSM_FOLLOW_SYMLINKS, IOSM_HREAD, IOSM_HWRITE, IOSM_INIT, IOSM_INTERNAL, IOSM_LCHOWN, IOSM_LINK, IOSM_LSETFCON, IOSM_LSTAT, IOSM_MAP, IOSM_MKDIR, IOSM_MKDIRS, IOSM_MKFIFO, IOSM_MKLINKS, IOSM_MKNOD, IOSM_NEXT, IOSM_NOTIFY, IOSM_PAD, IOSM_PAYLOAD_EXTRACT, IOSM_PAYLOAD_LIST, IOSM_PKGBUILD, IOSM_PKGCOMMIT, IOSM_PKGERASE, IOSM_PKGINSTALL, IOSM_POS, IOSM_POST, IOSM_PRE, IOSM_PROCESS, IOSM_RCLOSE, IOSM_READ, IOSM_READLINK, IOSM_RENAME, IOSM_RMDIR, IOSM_RMDIRS, IOSM_ROPEN, IOSM_SBIT_CHECK, IOSM_STAT, IOSM_SYMLINK, IOSM_SYSCALL, IOSM_TRAILER, IOSM_UNDO, IOSM_UNKNOWN, IOSM_UNLINK, IOSM_UTIME, IOSM_VERBOSE, IOSM_VERIFY, IOSM_WCLOSE, IOSM_WOPEN, IOSM_WRITE, iosmCommitLinks(), iosmFileActionSkipped(), iosmFileStageString(), iosmFsPath(), iosmGetFi(), iosmMakeLinks(), iosmMapAttrs(), iosmMapFContext(), iosmMapPath(), iosmMkdirs(), iosmNext(), iosmRmdirs(), iosmUNSAFE, IS_DEV_LOG, Lchown(), Link(), lsetfilecon, Lstat(), mapFind(), mapNextIterator(), Mkdir(), Mkfifo(), Mknod(), Readlink(), Rename(), Rmdir(), RPMCALLBACK_INST_PROGRESS, RPMFILE_GHOST, RPMFILE_MISSINGOK, rpmlog(), RPMLOG_DEBUG, RPMLOG_ERR, RPMLOG_WARNING, rpmswAdd(), rpmtsNotify(), S_ISLNK, S_ISSOCK, saveHardLink(), Stat(), stpcpy(), Symlink(), Unlink(), urlPath(), Utime(), writeFile(), writeLinkedFile(), xmalloc(), and xstrdup().

Referenced by fsmStage(), and iosmNext().

int iosmTeardown | ( | IOSM_t | iosm | ) |

Clean I/O state machine.

Parameters

  iosm | I/O state machine

Returns
  0 on success

Definition at line 793 of file iosm.c.

References _free(), fdFree(), IOSM_DESTROY, iosmUNSAFE, mapFreeIterator(), rpmswAdd(), RPMTS_OP_DIGEST, rpmtsFree(), and rpmtsOp().

static void* mapFreeIterator | ( | void * | p | ) |

static

Destroy file info iterator.

Parameters

  p | file info iterator

Return values

  NULL | always

Definition at line 142 of file iosm.c.

References _free(), and rpmfiUnlink().

Referenced by freeIOSM(), and iosmTeardown().

static void* mapInitIterator | ( | rpmfi | fi,
|  | int | reverse
| ) |  |

static

Create file info iterator.

Parameters

  fi | transaction element file info
  reverse | iterate in reverse order?

Returns
  file info iterator

Definition at line 163 of file iosm.c.

References reverse, rpmfiLink(), and xcalloc().

Referenced by iosmSetup().

static int mapNextIterator | ( | void * | a | ) |

static

Return next index into file info.

Parameters

  a | file info iterator

Returns
  next index, -1 on termination

Definition at line 186 of file iosm.c.

Referenced by iosmStage(), and mapFind().

IOSM_t newIOSM | ( | void |  | ) |

Definition at line 565 of file iosm.c.

References xcalloc().

static int saveHardLink | ( | IOSM_t | iosm | ) |

static

Save hard link in chain.

Parameters

  iosm | file state machine data

Returns
  Is chain only partially filled?

Definition at line 469 of file iosm.c.

References _free(), IOSM_MAP, IOSM_PKGBUILD, IOSM_PKGINSTALL, iosmFileActionSkipped(), iosmGetFi(), iosmNext(), and xcalloc().

Referenced by iosmStage().

static int writeFile | ( | IOSM_t | iosm,
|  | int | writeData
| ) |  |

static

Write next item to payload stream.

Parameters

  iosm | file state machine data
  writeData | should data be written?

Returns
  0 on success

Definition at line 1107 of file iosm.c.

References alloca(), Fileno(), IOSM_DWRITE, IOSM_HWRITE, IOSM_MAP_ABSOLUTE, IOSM_MAP_ADDDOT, IOSM_MAP_PATH, IOSM_PAD, IOSM_RCLOSE, IOSM_READ, IOSM_READLINK, IOSM_ROPEN, iosmGetFi(), iosmNext(), iosmUNSAFE, S_ISLNK, stpcpy(), urlPath(), and xstrdup().

Referenced by iosmStage(), and writeLinkedFile().

static int writeLinkedFile | ( | IOSM_t | iosm | ) |

static

Write set of linked files to payload stream.

Parameters

  iosm | file state machine data

Returns
  0 on success

Definition at line 1242 of file iosm.c.

References _free(), IOSM_MAP, iosmNext(), stpcpy(), tarHeaderWrite(), urlPath(), writeFile(), xmalloc(), and xstrdup().

Referenced by iosmStage().

## Variable Documentation

int _iosm_debug = 0

Definition at line 67 of file iosm.c.

Referenced by iosmSetup().

int _iosm_threads = 0

Definition at line 71 of file iosm.c.

Referenced by iosmSetup().

int(* _iosmNext)(IOSM_t iosm, iosmFileStage nstage) = &iosmNext

Definition at line 75 of file iosm.c.

Referenced by arHeaderRead(), arHeaderWrite(), arRead(), arTrailerWrite(), arWrite(), cpioHeaderRead(), cpioHeaderWrite(), cpioRead(), cpioTrailerWrite(), cpioWrite(), fsmSetup(), iosmSetup(), tarHeaderWrite(), tarHeaderWriteName(), tarRead(), tarTrailerWrite(), and tarWrite().