summaryrefslogtreecommitdiff
path: root/tbdiff/tbdiff-apply.c
Commit message (Collapse)AuthorAgeFilesLines
* Use POSIX file operations internally in tbdiff-applyBen Brewer2014-06-041-29/+28
| | | | | | For consistency reasons and because the POSIX functions are more consistent and simple, this also allows us to set the mode on file creation and detect if a file already exists.
* Use POSIX file operations for tbdiff-applyBen Brewer2014-06-041-77/+78
| | | | For the consistency reasons listed in earlier commits.
* Use quoted includes for local headers in tbdiff source filesBen Brewer2014-06-021-4/+4
| | | | | | | | | Quoted includes should be used when including headers which represent declarations in local source files. The source files have been modified to reflect this. This makes it more clear which headers are system headers and which are part of the tbdiff codebase.
* Remove use of typedef to avoid naming conflicts with POSIXBen Brewer2014-06-021-4/+4
| | | | | | | | | | | | POSIX reserves the use of the underscore T postfix for types, since most of the time we don't actually need to typedef the types and since it's more clear to prefix structs and enums with the struct and enum keywords, I've removed all uses of typedef and gone with the more simple approach used in the kernel. One typedef remains which is tbd_cmd_type, since this should be a native type of a fixed size. The postfix changed to type to show that it's a type and to ensure it doesn't collide with POSIX.
* Print warning using TBD_WARN when chown failsbaserock/benbrewer/overhaul-v2Ben Brewer2014-06-021-8/+17
| | | | | | The compiler currently warns that the result of chown is ignored, for now we'll print a warning when the chown operation fails, but it'll need to be handled as an error eventually.
* Use TBD_DEBUG macro to print the value of an invalid commandBen Brewer2014-06-021-1/+1
| | | | | Use the TBD_DEBUG macro since it will be disabled when debug is disabled, otherwise we'd always print the error message.
* Use TBD_DEBUG macro instead of fprint for debug messagesBen Brewer2014-06-021-10/+10
| | | | | We now use the TBD_DEBUG macro rather than fprintf, this means that debug messages aren't printed when debugging is disabled.
* style: Rename fread/fwrite in function names to read and writeBen Brewer2014-06-021-8/+8
| | | | | | | | The implementation currently uses fread and fwrite which are specific functions in stdlib, however this is an implementation detail and in the future these functions may not be used, so it doesn't make sense to name the higher level functions based on the function they use underneath.
* style: Cleanup the names of the tbd read/write wrappersBen Brewer2014-06-021-46/+46
|
* Create tbd_cmd_t type to for commands and use sizeof in writeBen Brewer2014-06-021-4/+4
| | | | | | Previously commands were just treated as a uint8_t and given the value of and enum. This is now made more clear in the code by defining tbd_cmd_t as a uint8_t below the enum in tbdiff-common.h.
* style: Fix alignment and func defs in tbdiff-apply.cBen Brewer2014-06-021-29/+34
|
* style: Convert all cpp style comments to c style commentsBen Brewer2014-06-021-10/+10
|
* Fix fp resource leaks in tbdiff-applyBen Brewer2014-06-021-21/+48
| | | | | There were a lot of instances where on error the code would fail to close the opened file pointer.
* Use sys/xattr from libc if attr/xattr is unavailableBen Brewer2014-06-021-1/+7
| | | | | | | | | | | | On my system tbdiff failed to build because attr/xattr doesn't exist, also the attr package was not easy to find. On searching I discovered that the functionality we use in attr.h is provided by modern versions of libc, as shown here: https://bugzilla.kernel.org/show_bug.cgi?id=70141 This patch falls back to using libc sys/xattr.h when attr/xattr.h is unavailable.
* Switch to a shared tbdiff library and make this an autotools project.Jannis Pohlmann2012-03-221-0/+740
This commit converts tbdiff to being an autotools-based project. This means that we now support the usual autoreconf -i && ./configure && make && make install process, plus we provide 'make check' for the tbdiff test suite. The tbdiff library is now build as a shared library and is also installed into the system for others to use. The library is libtool-versioned and ships a pkg-config file (tbdiff-1.pc). The headers were adjusted so that only tbdiff/tbdiff.h may be included directly; all others are considered internal. The tbdiff-create and tbdiff-deploy tools were changed to include this header file. The tbdiff library is still GPL, not LGPL. We might want to change this in the future. Thanks to switching to autotools we now have a way to make releases by means of 'make dist' and 'make distcheck'. Unfortunately, the latter currently fails, probably due to something being missing in tbdiff/Makefile.am.