summaryrefslogtreecommitdiff
path: root/src/unix/posix.h
Commit message (Collapse)AuthorAgeFilesLines
* p_futimes: support using futimens when availableEdward Thomson2015-09-301-1/+14
|
* posix compat: include sys/stat.h for mingwEdward Thomson2015-06-301-0/+1
|
* Fixed Xcode 6.1 build warningsPierre-Olivier Latour2015-06-171-0/+1
|
* Introduce p_utimes and p_futimesEdward Thomson2015-06-161-1/+3
| | | | | | Provide functionality to set the time on a filesystem entry, using utimes or futimes on POSIX type systems or SetFileTime on Win32.
* crlf: tick the index forward to work around racy-git behaviourCarlos Martín Nieto2015-06-161-0/+1
| | | | | | | | | | | | In order to avoid racy-git, we zero out the file size for entries with the same timestamp as the index (or during the initial checkout). This is the case in a couple of crlf tests, as the code is fast enough to do everything in the same second. As we know that we do not perform the modification just after writing out the index, which is what this is designed to work around, tick the mtime of the index file such that it doesn't agree with the files anymore, and we do not zero out these entries.
* git_path: introduce 'git_path_diriter'Edward Thomson2015-05-011-0/+1
| | | | | Introduce a new `git_path_diriter` that can iterate directories efficiently for each platform.
* Introduce some consistency in definition/declaration orderingJacques Germishuys2014-08-051-4/+3
|
* Move p_realpath logic to realpath.cJacques Germishuys2014-08-051-7/+1
|
* Cleanup portability/compatibility layerJacques Germishuys2014-08-051-1/+22
| | | | | | | * Removes mingw-compat.h * Cleans up separation of compiler/platform idiosyncrasies * Unifies mingw/msvc stat structures and functions * (Tries to) hide more compiler specific implementation details (even in our internal API)
* Fix unix/posix.h include guardJacques Germishuys2014-07-131-2/+2
|
* Win32: UTF-8 <-> WCHAR conversion overhaulPhilip Kelley2014-04-191-1/+0
|
* Add missing prototype for p_realpath().Jasper Lievisse Adriaanse2013-04-221-0/+2
|
* Make tree iterator handle icase equivalenceRussell Belfer2013-03-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | There is a serious bug in the previous tree iterator implementation. If case insensitivity resulted in member elements being equivalent to one another, and those member elements were trees, then the children of the colliding elements would be processed in sequence instead of in a single flattened list. This meant that the tree iterator was not truly acting like a case-insensitive list. This completely reworks the tree iterator to manage lists with case insensitive equivalence classes and advance through the items in a unified manner in a single sorted frame. It is possible that at a future date we might want to update this to separate the case insensitive and case sensitive tree iterators so that the case sensitive one could be a minimal amount of code and the insensitive one would always know what it needed to do without checking flags. But there would be so much shared code between the two, that I'm not sure it that's a win. For now, this gets what we need. More tests are needed, though.
* Fix p_realpath on OpenBSDCarlos Martín Nieto2013-01-291-1/+6
| | | | | | OpenBSD's realpath(3) doesn't require the last part of the path to exist. Override p_realpath in this OS to bring it in line with the library's assumptions.
* update copyrightsEdward Thomson2013-01-081-1/+1
|
* Add POSIX compat lstat() variant for win32Russell Belfer2012-11-141-0/+3
| | | | | | | | | | The existing p_lstat implementation on win32 is not quite POSIX compliant when setting errno to ENOTDIR. This adds an option to make is be compliant so that code (such as checkout) that cares to have separate behavior for ENOTDIR can use it portably. This also contains a couple of other minor cleanups in the posix_w32.c implementations to avoid unnecessary work.
* Move inet_pton to posix platform-compatibility layerEduardo Bart2012-11-071-0/+1
|
* Always use internal fnmatch, not systemRussell Belfer2012-10-151-7/+0
|
* Some cleanup suggested during reviewRussell Belfer2012-08-221-1/+0
| | | | | | | | | | This cleans up a number of items suggested during code review with @vmg, including: * renaming "outside repo" config API to `git_config_open_default` * killing the `git_config_open_global` API * removing the `git_` prefix from the static functions in fileops * removing some unnecessary functionality from the "cp" command
* Add template dir and set gid to repo initRussell Belfer2012-08-221-0/+1
| | | | | | | | | | | | | | | | | This extends git_repository_init_ext further with support for initializing the repository from an external template directory and with support for the "create shared" type flags that make a set GID repository directory. This also adds tests for much of the new functionality to the existing `repo/init.c` test suite. Also, this adds a bunch of new utility functions including a very general purpose `git_futils_mkdir` (with the ability to make paths and to chmod the paths post-creation) and a file tree copying function `git_futils_cp_r`. Also, this includes some new path functions that were useful to keep the code simple.
* Merge branch 'development' into cloneBen Straub2012-07-171-1/+1
|\
| * no fnmatch.hChris Young2012-06-071-1/+1
| |
* | Checkout: handle symlinks.Ben Straub2012-07-161-0/+1
|/ | | Includes unfinished win32 implementation.
* Fix readdir_r() usage for SolarisScott J. Goldman2012-05-121-0/+2
| | | | | | | | On Solaris, struct dirent is defined differently than Linux. The field containing the path name is of size 0, rather than NAME_MAX. So, we need to use a properly sized buffer on Solaris to avoid a stack overflow. Also fix some DIR* leaks on cleanup.
* Hook up Windows compat fnmatch() for SolarisScott J. Goldman2012-05-101-2/+6
| | | | | | | | Since Solaris does not support some of the same flags as glibc fnmatch(), we just use the implementation we have for Windows. Now that it's no longer a windows-specific thing, I moved it into compat/ instead of win32/
* Update diff to use iteratorsRussell Belfer2012-03-021-1/+0
| | | | | | | | | | | | | This is a major reorganization of the diff code. This changes the diff functions to use the iterators for traversing the content. This allowed a lot of code to be simplified. Also, this moved the functions relating to outputting a diff into a new file (diff_output.c). This includes a number of other changes - adding utility functions, extending iterators, etc. plus more tests for the diff code. This also takes the example diff.c program much further in terms of emulating git-diff command line options.
* Fix readdir usage across platformsRussell Belfer2012-02-231-0/+1
| | | | | | This fixes the missing readdir_r from win32 and fixes other platforms to always use the reentrant readdir_r form for reading directory contents.
* Update Copyright headerschu2012-02-131-1/+1
| | | | Signed-off-by: schu <schu-github@schulog.org>
* Create cross-platform setenvPaul Betts2011-09-191-0/+1
|
* Cleanup legal dataVicent Marti2011-09-191-0/+6
| | | | | | | | | | 1. The license header is technically not valid if it doesn't have a copyright signature. 2. The COPYING file has been updated with the different licenses used in the project. 3. The full GPLv2 header in each file annoys me.
* compat: Move `mkstemp` to the POSIX compat layerVicent Marti2011-08-301-0/+1
|
* posix: Properly handle `snprintf` in all platformsVicent Marti2011-08-181-0/+1
|
* unix/posix.h: remove redundant includeschu2011-08-171-1/+0
| | | | Signed-off-by: schu <schu-github@schulog.org>
* posix: Portable `vsnprintf`Vicent Marti2011-07-091-0/+1
| | | | | | | | | | | | | | | Our good, lovely folks at Microsoft decided that there was no good reason to make `vsnprintf` compilant with the C standard, so that function in Windows returns -1 on overflow, instead of returning the actual byte count needed to write the full string. We now handle this situation more gracefully with the POSIX compatibility layer, by returning the needed byte size using an auxiliary method instead of blindly resizing the target buffer until it fits. This means we can now support `printf`s of any size by allocating a temporary buffer. That's good.
* fnmatch: Use native on Unix, emulate on Win32Vicent Marti2011-07-061-0/+2
|
* fileops: Drop `git_fileops_prettify_path`Vicent Marti2011-07-051-1/+1
| | | | | | | | | | The old `git_fileops_prettify_path` has been replaced with `git_path_prettify`. This is a much simpler method that uses the OS's `realpath` call to obtain the full path for directories and resolve symlinks. The `realpath` syscall is the original POSIX call in Unix system and an emulated version under Windows using the Windows API.
* fileops: CleanupVicent Marti2011-07-051-0/+14
Cleaned up the structure of the whole OS-abstraction layer. fileops.c now contains a set of utility methods for file management used by the library. These are abstractions on top of the original POSIX calls. There's a new file called `posix.c` that contains emulations/reimplementations of all the POSIX calls the library uses. These are prefixed with `p_`. There's a specific posix file for each platform (win32 and unix). All the path-related methods have been moved from `utils.c` to `path.c` and have their own prefix.