path: root/ChangeLog.txt
AgeCommit message (Collapse)Author
2019-08-02use *correct* flags for open/openat, also apply them for related statHEADross/mastermasterSeebs
When statting a file that we may or may not be opening with O_NOFOLLOW, we should use lstat (or AT_SYMLINK_NOFOLLOW) to try to get information about the right file. Also when we want to check whether a bit is set, we should use & rather than |. I am an experienced programmer and know the difference between those.
2019-08-01handle O_NOFOLLOW in flags for open/openatSeebs
Did you know that, similar to AT_SYMLINK_NOFOLLOW, there's an O_NOFOLLOW available in flags for open/openat? I didn't.
2019-05-15Add SPDX-License-Identifier: LGPL-2.1-only to filesRichard Purdie
This adds SPDX license headers to all source files in pseudo so license identification models current best practise. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-10fix warnings in renameat2Seebs
Clean up the "unused parameter" warnings in renameat2.
2019-04-10Try to handle blocking open.Seebs
This is a heck of a special case: If you call open on a FIFO/pipe, and you didn't have O_NONBLOCK, and you used O_RDONLY or O_WRONLY, but not O_RDWR, the open can block forever. Unfortunately, pseudo assumes syscalls complete. We attempt to drop the lock and restore our state, then recover it later. Why? Because the .NET runtime does this for a debug hook.
2019-04-09don't renameat2 pleaseSeebs
So renameat2 now has a glibc wrapper in some recent glibc, which means that mv can use it, and thus bypass all our clever testing, and since we can't intercept the actual syscall (gnulib's implementation apparently doesn't hit the glibc syscall() wrapper?), this results in files being moved without pseudo knowing about them. Implementing the semantics properly is Very Hard, but possibly we can just fail politely for now. We'll be back to this later.
2019-04-09partial fix (??) for an ownership corruption problemSeebs
We've had really weird sporadic things, but it looks like the underlying problem is that something's getting symlinked over (which is clearly impossible), but we're nuking everything with that inode, rather than just the entry for that path, and this is causing us to drop ownership info for an existing thing.
2018-12-15pseudo_ipc.c: eliminate some code duplicationSeebs
Since msg->pathlen is set to len in the first branch, we can share the final submit-and-check-for-success part of the two branches. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Signed-off-by: Seebs <seebs@seebs.net>
2018-12-15Use MSG_NOSIGNAL if available.Seebs
MSG_NOSIGNAL has been in Linux since 2.2, and has been standardized in POSIX 2008. Using that when available avoids the overhead of the two syscalls to set and restore the SIGPIPE handler. Moreover, we can eliminate one write() call by making use of sendmsg() to do scatter-gather I/O. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Signed-off-by: Seebs <seebs@seebs.net>
2018-11-29add missing <stdint.h>Seebs
Turns out you need <stdint.h> for int64_t and friends and some systems were picking it up implicitly and others weren't.
2018-09-20also make sure inodes are 64-bit values to SQLSeebs
bind_int doesn't handle 64-bit ints on most targets, we need bind_int64, and weren't using it. What a silly bug. Caught and fixed by <Jack.Fewx@dell.com>. Signed-off-by: seebs <seebs@seebs.net>
2018-09-20fix gcc7 warningSeebs
2018-09-20attempt to handle large inode valuesSeebs
So ino_t is uint64_t, sqlite field types are magical and erratic and if a value doesn't fit inside signed int64, it gets converted to float64. of course. This means that the top half of the inode range produces invalid-ish values, because a 64-bit double is typically 53 bits of mantissa, so a value around 2^64 will convert to a float64 value which is going to compare equal to at least 2^10 other integer values if they were also converted to float64. Which makes weird problems.
2018-04-13Fix symlink following errorsSeebs
openat() was passing its flags unaltered to pseudo_root_path(), which assumes that a flags argument other than 0 means "don't follow symlinks in last path component". This is completely wrong, and I have no idea how it survived this long unnoticed. Now, if a plain flags variable is set and not overruled by a comment like /* flags=... */, it's masked with AT_SYMLINK_NOFOLLOW, as there are other values fstatat() and friends can take, and the openat() flags are just overridden with 0. (The only meaningful case would be O_NOFOLLOW, but O_NOFOLLOW instructs us to *fail* in the open if the path is a symlink, so we don't care.) Signed-off-by: Seebs <seebs@seebs.net>
2018-04-13Fix one more stray slashSeebs
After the rest of the restandardization on "path does not have to be slash-terminated", I missed the case where you get an absolute symlink, which could result in a path starting with an extra slash. Signed-off-by: Seebs <seebs@seebs.net>
2018-04-13Less chatty debuggingSeebs
Stop producing the path mismatch messages for things with multiple links. We could probably make this smarter, but for now this is sufficient to reduce the spam. pseudo_debug(0, ...) now produces a message, as a special case. Signed-off-by: Seebs <seebs@seebs.net>
2018-04-03Change copyright default.Seebs
Too lazy to go back and change it, so Wind River can keep the copyright on my shiny new completely-unused syscall internals, but I'm fixing the default copyright message for new wrappers. Signed-off-by: Seebs <seebs@seebs.net>
2018-03-31initialize wrappers in syscall wrapperSeebs
But what if syscall(2) was the *first* function with a wrapper that you called? Also reduced amount of argument-copying in syscall(2), on further study, anything with off_t arguments has less than 6 arguments by enough to keep the total argument count down. Signed-off-by: Seebs <seebs@seebs.net>
2018-03-31don't change errno in pseudo_fix_pathSeebs
Two issues: (1) pseudo_fix_path could call lstat("") which generated ENOENT, (2) some people, and I'm totally not staring intently at cross-localedef here, don't know that it is in general *not* valid to check errno unless an operation has failed, and the mere fact that something set errno does not mean that the error indicated actually occurred or has any relevance to you. Nonetheless, pseudo_fix_path now saves and restores errno, and cross-localedef can just go ahead and check it as though it were guaranteed not to sometimes get set even though no error occurred. Signed-off-by: Seebs <seebs@seebs.net>
2018-03-30Fix sticky bits and a couple of test cases.Seebs
Merge fixes from Richard Tollerton and associated test cases and permissions fixes. Signed-off-by: Seebs <seebs@seebs.net>
2018-03-30Update README and ChangeLog.Seebs
Signed-off-by: Seebs <seebs@seebs.net>
2018-03-29Experimental syscall(2) wrapper.Seebs
This wrapper should allow us to reject renameat2 attempts by coreutils, letting us regain functionality on FC27 and related systems. This is not safe/portable/etc even by pseudo's standards, and arguably it should be a separate and optional port. [Amended commit: Don't include the dodgy renameat2 wrapper which it turns out we'd never hit anyway.] Signed-off-by: Seebs <seebs@seebs.net>
2018-03-06Improve path handling by not dereferencing filesSeebs
The path handling was stripping /., or moving back up a level for /.., even when the current thing was a plain file, resulting in the surprising behavior that "a/." was a valid name for a file called a, which canonicalized without the extra directory. This breaks some stuff occasionally. (Related to, but not the same as, the previous issues with the use of trailing slashes in names to match only directories.) This is not yet well-tested. Signed-off-by: Seebs <seebs@seebs.net>
2018-03-01Don't delete things and not create them.Seebs
When OP_CREAT comes in, if there's an existing entry with the same inode, we nuke that entry because CREAT implies a new file got that inode, and if there's an existing entry with the same path, we don't create a link, because there's already something there. So if there's a single entry with the same path and inode, it gets deleted and not recreated. Oops. Now distinguishing between a single exact match of both path and inode, and distinct matches by path and by inode. This addresses a use case where parallel creations could in theory cause pseudo to mistakenly drop database entries, potentially. (I could only trigger it by doing this to files which had existing entries, and then deleting the files outside of pseudo, though.) Signed-off-by: seebs <seebs@seebs.net>
2018-02-26Handle more mk*stemp* functions.Seebs
The mkostemps() family are all bad but people use them so here we are. Since mkstemp(), mkstemps(), and mkostemp() can all be implemented by calling mkostemps() with additional zeroes passed in, do it that way. Signed-off-by: Seebs <seebs@seebs.net>
2018-02-19Epoll: use the correct clientSeebs
So in the non-listen-fd case, apparently I broke the code to use the index of the returned event, rather than the corresponding ID value registered with epoll, as the index into the clients array. This, of course, was nonsense, and explains why we were seeing a ton of attempts to modify client 0. This also reverts the previous, incorrect, attempt to address all those messages. Signed-off-by: seebs <seebs@seebs.net>
2018-02-16Allow closing client 0Seebs
It seems like the epoll setup can in some cases end up with a client #0, which the code would refuse to close, so it just looped forever. Only reject negative numbers, not zero. Signed-off-by: seebs <seebs@seebs.net>
2018-02-15Handle O_TMPFILE more betterSeebs
O_TMPFILE is, on at least one system, (__O_TMPFILE | O_DIRECTORY), so (flags & O_TMPFILE) can be non-zero even when O_TMPFILE was not set. Signed-off-by: Seebs <seebs@seebs.net>
2018-01-20Fix openat flag #ifdef typopseudo-1.9.0PSEUDO_1_9_0Seebs
Whoops, missed this one. Reported/submitted by <joshua.g.lock@linux.intel.com>. Signed-off-by: Seebs <seebs@seebs.net>
2018-01-16Half-undo FASTOPSeebs
FASTOP is logically fine as long as there's no errors, but if there could be errors, we lose error detection. Responding instantly with a trivial ACK for FASTOP messages slightly reduces performance but improves reliability and seems to work better. Signed-off-by: Seebs <seebs@seebs.net>
2018-01-16Add statvfs wrapperSeebs
Patch was submitted by <dan.dedrick@gmail.com>, revised to make it a subport in case someone cares about a Linux system which doesn't have this function. (Which is probably unlikely, but I am a cautious sort.) Signed-off-by: Seebs <seebs@seebs.net>
2018-01-16Merge epoll supportSeebs
Original commit message: The idea came up here: https://bugzilla.yoctoproject.org/show_bug.cgi?id=11309 and here: http://lists.openembedded.org/pipermail/openembedded-core/2017-August/141491.html Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> I've adapted this to make epoll a configure-time option; you must use --enable-epoll to get the new behavior. I've also confirmed that it builds both ways and appears to run, and restored the SIGUSR2 functionality (except for the state check) for the epoll case. Signed-off-by: Seebs <seebs@seebs.net>
2018-01-16Drop diagnostic for missing "real" functionsSeebs
It turns out that these diagnostics can be spurious now on some hosts, also that they've probably been wrong forever; for instance, on some Linux, there's not a real "mknod" function and probably never was, so reporting this error is pointless. Signed-off-by: Seebs <seebs@seebs.net>
2018-01-16Handle long lines in /etc/groupSeebs
This allows the pseudo /etc/group to contain extremely long lines, e.g. when a group has a lot of members. Without this, chown and chgrp fail for group names that occur after such long lines. Signed-off-by: Zoltán Böszörményi <zboszor@pr.hu> Signed-off-by: Seebs <seebs@seebs.net> --- ports/darwin/guts/getgrouplist.c | 54 +++++++++++++++++++++++++++----------- ports/linux/guts/getgrouplist.c | 54 +++++++++++++++++++++++++++----------- ports/uids_generic/guts/getgrent.c | 26 +++++++++++++++--- ports/uids_generic/guts/getgrgid.c | 26 +++++++++++++++--- ports/uids_generic/guts/getgrnam.c | 25 +++++++++++++++--- 5 files changed, 146 insertions(+), 39 deletions(-)
2018-01-16handle O_TMPFILE and linkat()Seebs
This is a rework which replaces a previous patch. In this version, files created with O_TMPFILE don't get recorded in the database at all, but if we get a link request for /proc/self/fd/N, and the corresponding file is not in the database, we send a CREAT request for it instead of a LINK, and that appears to work with a MUCH reduced chance of database leakage. Also the O_TMPFILE won't be creating bogus database entries anymore. Signed-off-by: Seebs <seebs@seebs.net> linkat fix
2017-12-18Print list of clients on SIGUSR2Seebs
This patch relates to some debugging of handling of large numbers of clients, but actually it seems useful to have, so checking it in. Signed-off-by: Seebs <seebs@seebs.net>
2017-04-13Prevent bash from segfaulting when unloading pseudoSeebs
bash's extremely fancy internal awareness of how the environment looks means that, if you directly call the underlying libc "unsetenv" on a variable, bash can end up trying to access a null pointer. Fixing this generically is actually rather hard; you can't really avoid writing to environ on fork() or popen(), even if you change all execv*() functions to use the execv*e() variants. So for now, instead of unsetting the variable, set it to an empty string. Thanks to Saur in IRC for spotting this and helping debug it. Signed-off-by: Seebs <seebs@seebs.net>
2017-02-24Don't try to record 0-length posix_acl_default xattrsSeebs
Based on a submission from Anton Gerasimov <anton@advancedtelematic.com> On some systems, with some kernel configs, "cp -a" apparently tries to set an empty ACL list, with a valid header but no contents, which causes strange and mysterious behavior later if we actually create such an entry. So filter that out, also sanity-check a couple of other things. Signed-off-by: Seebs <seebs@seebs.net>
2017-02-03Makefile.in: Stop rebuilding binaries so much.Seebs
Currently, the Makefile rebuilds the binary at every invokation of the command make: $ make cc -pipe -std=gnu99 -Wall -W -Wextra -fPIC -D_LARGEFILE64_SOURCE -D_ATFILE_SOURCE -m64 -DPSEUDO_PREFIX='"/opt"' -DPSEUDO_SUFFIX='""' -DPSEUDO_BINDIR='"bin"' -DPSEUDO_LIBDIR='"lib64"' -DPSEUDO_LOCALSTATEDIR='"var/pseudo"' -DPSEUDO_VERSION='"1.8.1"' -DUSE_MEMORY_DB -DPSEUDO_PASSWD_FALLBACK='""' -DPSEUDO_XATTR_SUPPORT -O2 -g -o bin/pseudo \ pseudo.o pseudo_server.o pseudo_client.o pseudo_ipc.o \ pseudo_db.o pseudo_tables.o pseudo_util.o -lsqlite3 -lpthread -ldl -lpthread cc -pipe -std=gnu99 -Wall -W -Wextra -fPIC -D_LARGEFILE64_SOURCE -D_ATFILE_SOURCE -m64 -DPSEUDO_PREFIX='"/opt"' -DPSEUDO_SUFFIX='""' -DPSEUDO_BINDIR='"bin"' -DPSEUDO_LIBDIR='"lib64"' -DPSEUDO_LOCALSTATEDIR='"var/pseudo"' -DPSEUDO_VERSION='"1.8.1"' -DUSE_MEMORY_DB -DPSEUDO_PASSWD_FALLBACK='""' -DPSEUDO_XATTR_SUPPORT -O2 -g -o bin/pseudodb pseudodb.o \ pseudo_db.o pseudo_tables.o pseudo_util.o pseudo_ipc.o -lsqlite3 -lpthread -ldl -lpthread The fault comes from the $(BIN) directory prerequesite. According to the documention of GNU make(*), directory prerequesites normally go to <order-only-prerequisites>: targets: normal-prerequisites | order-only-prerequisites > Consider an example where your targets are to be placed in a separate > directory, and that directory might not exist before make is run. In > this situation, you want the directory to be created before any > targets are placed into it but, because the timestamps on directories > change whenever a file is added, removed, or renamed, we certainly > don’t want to rebuild all the targets whenever the directory’s > timestamp changes. One way to manage this is with order-only > prerequisites: make the directory an order-only prerequisite on all > the targets. > > OBJDIR := objdir > OBJS := $(addprefix $(OBJDIR)/,foo.o bar.o baz.o) > > $(OBJDIR)/%.o : %.c > $(COMPILE.c) $(OUTPUT_OPTION) $< > > all: $(OBJS) > > $(OBJS): | $(OBJDIR) > > $(OBJDIR): > mkdir $(OBJDIR) > > Now the rule to create the objdir directory will be run, if needed, > before any ‘.o’ is built, but no ‘.o’ will be built because the > objdir directory timestamp changed. This patch fixes this behavior. No binaries are rebuilt when the command make is re-run: $ make make: Nothing to be done for 'all'. *: https://www.gnu.org/software/make/manual/html_node/Prerequisite-Types.html Signed-off-by: Gaël PORTAY <gael.portay@savoirfairelinux.com> Signed-off-by: Seebs <seebs@seebs.net>
2017-02-01pseudo 1.8.2pseudo-1.8.2PSEUDO_1_8_2Seebs
2017-02-01don't remove xattrs still in useSeebs
When deleting a specific file, delete xattrs only if it's the last file with that device/inode pair. Signed-off-by: Seebs <seebs@seebs.net>
2016-12-12From: Andrew Shadura <andrewsh@debian.org>Seebs
Each manual page should start with a "NAME" section, which lists the name and a brief description of the page separated by "\-". Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com> Signed-off-by: Seebs <seebs@seebs.net>
2016-12-12The setcap utility supplied by libcap is used to set capabilities on aSeebs
file. Before setting a file's capabilities with cap_set_file() (which uses setxattr()) it calls cap_set_flag(mycaps, CAP_EFFECTIVE, 1, &capflag, CAP_SET). cap_set_flag() uses the capset syscall to raise the process' effective capability. In most cases if the process isn't running as root this will fail and setcap will exit with an error. Because setxattr is intercepted by pseudo it's unnecessary for setcap to call capset(). Override capset with a pseudo function that does nothing and always returns 0. Signed-off-by: George McCollister <george.mccollister at gmail.com> Signed-off-by: Seebs <seebs@seebs.net>
2016-12-12From: Rabin Vincent <rabinv@axis.com>Seebs
When tclsh forks it can create new threads in the child process, in a pthread_atfork() handler. Running this under pseudo results in a deadlock since the pseudo_lock() call in the new thread in the child process premanently believes that the mutex is already locked by another thread (which actually only existed in the parent process). The provided test cases reproduces this. Similar hangs can also been seen in other cases, such as when attempting to use vim's cscope support under pseudo. Fix it by reseting the mutex in a pthread_atfork() child function. Signed-off-by: Rabin Vincent <rabinv@axis.com> Signed-off-by: Seebs <seebs@seebs.net>
2016-12-12From: Rabin Vincent <rabinv@axis.com>Seebs
test-umask fails if run twice. Make it remove the created temporary files before the test. Signed-off-by: Rabin Vincent <rabinv@axis.com> Signed-off-by: Seebs <seebs@seebs.net>
2016-12-12Python scripts are now compatible with both version of python, 2 and 3.Seebs
Helped-by: Damien Riegel <damien.riegel@savoirfairelinux.com> Helped-by: Alexandre Leblanc <alexandre.leblanc@savoirfairelinux.com> Signed-off-by: Gaël PORTAY <gael.portay@savoirfairelinux.com> Signed-off-by: Seebs <seebs@seebs.net>
2016-12-12Python 3 says:Seebs
File "./makewrappers", line 459 print port ^ SyntaxError: Missing parentheses in call to 'print' Signed-off-by: Gaël PORTAY <gael.portay@savoirfairelinux.com> Signed-off-by: Seebs <seebs@seebs.net> --- maketables | 12 ++++++------ makewrappers | 32 ++++++++++++++++---------------- templatefile.py | 8 ++++---- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/maketables b/maketables index b32312e..0726485 100755 --- a/maketables +++ b/maketables @@ -73,7 +73,7 @@ class DataType: for col in columns: indexed = False if col.startswith("FLAGS"): - print "Flags: set for %s" % self.name + print("Flags: set for %s" % self.name) self.flags = True continue if col.startswith("INDEXED "): @@ -248,7 +248,7 @@ def main(): template_file.emit('header') templates.append(template_file) except IOError: - print "Invalid or malformed template %s. Aborting." % path + print("Invalid or malformed template %s. Aborting." % path) exit(1) for filename in sys.argv[1:]: @@ -256,15 +256,15 @@ def main(): sys.stdout.write("%s: " % filename) datatype = DataType(filename) datatypes.append(datatype) - print datatype.__repr__() - print "" + print(datatype.__repr__()) + print("") - print "Writing datatypes...", + print("Writing datatypes...") for datatype in datatypes: # populate various tables and files with each datatype for template_file in templates: template_file.emit('body', datatype) - print "done. Cleaning up." + print("done. Cleaning up.") for template_file in templates: # clean up files diff --git a/makewrappers b/makewrappers index 303e2cc..bac856b 100755 --- a/makewrappers +++ b/makewrappers @@ -456,7 +456,7 @@ additional ports to include. self.name = port self.subports = [] self.preports = [] - print port + print(port) if os.path.exists(self.portfile("pseudo_wrappers.c")): self.wrappers = self.portfile("pseudo_wrappers.c") @@ -504,17 +504,17 @@ additional ports to include. prefuncs = pre.functions() for name in prefuncs.keys(): if name in mergedfuncs: - print "Warning: %s from %s overriding %s" % (name, pre.name, mergedfuncs[name].port) + print("Warning: %s from %s overriding %s" % (name, pre.name, mergedfuncs[name].port)) mergedfuncs[name] = prefuncs[name] for name in self.funcs.keys(): if name in mergedfuncs: - print "Warning: %s from %s overriding %s" % (name, self.name, mergedfuncs[name].port) + print("Warning: %s from %s overriding %s" % (name, self.name, mergedfuncs[name].port)) mergedfuncs[name] = self.funcs[name] for sub in self.subports: subfuncs = sub.functions() for name in subfuncs.keys(): if name in mergedfuncs: - print "Warning: %s from %s overriding %s" % (name, sub.name, mergedfuncs[name].port) + print("Warning: %s from %s overriding %s" % (name, sub.name, mergedfuncs[name].port)) mergedfuncs[name] = subfuncs[name] return mergedfuncs @@ -576,11 +576,11 @@ def process_wrapfuncs(port): func.directory = directory funcs[func.name] = func sys.stdout.write(".") - except Exception, e: - print "Parsing failed:", e + except Exception(e): + print("Parsing failed:", e) exit(1) funclist.close() - print "" + print("") return funcs def main(argv): @@ -599,35 +599,35 @@ def main(argv): for path in glob.glob('templates/*'): try: - print "Considering template: " + path + print("Considering template: " + path) source = TemplateFile(path) if source.name.endswith('.c') or source.name.endswith('.h'): source.emit('copyright') source.emit('header') sources.append(source) except IOError: - print "Invalid or malformed template %s. Aborting." % path + print("Invalid or malformed template %s. Aborting." % path) exit(1) try: port = Port('common', sources) except KeyError: - print "Unknown uname -s result: '%s'." % uname_s - print "Known system types are:" - print "%-20s %-10s %s" % ("uname -s", "port name", "description") + print("Unknown uname -s result: '%s'." % uname_s) + print("Known system types are:") + print("%-20s %-10s %s" % ("uname -s", "port name", "description")) for key in host_ports: - print "%-20s %-10s %s" % (key, host_ports[key], - host_descrs[host_ports[key]]) + print("%-20s %-10s %s" % (key, host_ports[key], + host_descrs[host_ports[key]])) # the per-function stuff - print "Writing functions...", + print("Writing functions...") all_funcs = port.functions() for name in sorted(all_funcs.keys()): # populate various tables and files with each function for source in sources: source.emit('body', all_funcs[name]) - print "done. Cleaning up." + print("done. Cleaning up.") for source in sources: # clean up files diff --git a/templatefile.py b/templatefile.py index 2789b22..abf9a2c 100644 --- a/templatefile.py +++ b/templatefile.py @@ -79,13 +79,13 @@ class TemplateFile: return path = Template(self.path).safe_substitute(item) if os.path.exists(path): - # print "We don't overwrite existing files." + # print("We don't overwrite existing files.") return self.file = open(path, 'w') if not self.file: - print "Couldn't open '%s' (expanded from %s), " \ + print("Couldn't open '%s' (expanded from %s), " \ "not emitting '%s'." % \ - (path, self.path, template) + (path, self.path, template)) return def emit(self, template, item=None): @@ -103,7 +103,7 @@ class TemplateFile: self.file.write(templ.safe_substitute(item)) self.file.write("\n") else: - print "Warning: Unknown template '%s'." % template + print("Warning: Unknown template '%s'." % template) if self.file_per_item: if self.file: -- 2.10.1
2016-12-12Python 3 reports:Seebs
File "./makewrappers", line 327 return """/* This function is not called if pseudo is configured --enable-force-async */ ^ TabError: inconsistent use of tabs and spaces in indentation Signed-off-by: Gaël PORTAY <gael.portay@savoirfairelinux.com> Signed-off-by: seebs <seebs@seebs.net> --- makewrappers | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/makewrappers b/makewrappers index e9191ed..303e2cc 100755 --- a/makewrappers +++ b/makewrappers @@ -324,7 +324,7 @@ class Function: def maybe_async_skip(self): if self.async_skip: - return """/* This function is not called if pseudo is configured --enable-force-async */ + return """/* This function is not called if pseudo is configured --enable-force-async */ #ifdef PSEUDO_FORCE_ASYNC if (!pseudo_allow_fsync) { PROFILE_DONE; @@ -333,7 +333,7 @@ class Function: #endif """ % self.async_skip else: - return "" + return "" def comment(self): """declare self (in a comment)""" @@ -393,11 +393,11 @@ class Function: def rc_format(self): """the format string to use for the return value""" - return typedata.get(self.type, { 'format': '[%s]', 'value': '"' + self.type + '"' })['format'] + return typedata.get(self.type, { 'format': '[%s]', 'value': '"' + self.type + '"' })['format'] def rc_value(self): """the value to pass for the format string for the return value""" - return typedata.get(self.type, { 'format': '[%s]', 'value': '"' + self.type + '"' })['value'] + return typedata.get(self.type, { 'format': '[%s]', 'value': '"' + self.type + '"' })['value'] def rc_decl(self): """declare rc (if needed)""" @@ -456,7 +456,7 @@ additional ports to include. self.name = port self.subports = [] self.preports = [] - print port + print port if os.path.exists(self.portfile("pseudo_wrappers.c")): self.wrappers = self.portfile("pseudo_wrappers.c") @@ -522,11 +522,11 @@ additional ports to include. return '#define PSEUDO_PORT_%s 1' % string.upper(self.name).replace('/', '_') def portdeps(self): - deps = [] - if self.wrappers: - deps.append(self.wrappers) - if self.portdef_file: - deps.append(self.portdef_file) + deps = [] + if self.wrappers: + deps.append(self.wrappers) + if self.portdef_file: + deps.append(self.portdef_file) if deps: return 'pseudo_wrappers.o: %s' % ' '.join(deps) else: @@ -590,7 +590,7 @@ def main(argv): for arg in argv: name, value = arg.split('=') - os.environ["port_" + name] = value + os.environ["port_" + name] = value # error checking helpfully provided by the exception handler copyright_file = open('guts/COPYRIGHT') @@ -599,9 +599,9 @@ def main(argv): for path in glob.glob('templates/*'): try: - print "Considering template: " + path + print "Considering template: " + path source = TemplateFile(path) - if source.name.endswith('.c') or source.name.endswith('.h'): + if source.name.endswith('.c') or source.name.endswith('.h'): source.emit('copyright') source.emit('header') sources.append(source) -- 2.10.1
2016-11-23Make pseudo -S cmd wait for serverSeebs
If you're running pseudo in docker, a script that creates a pseudo daemon can exit, causing docker to kill pseudo before it's done writing the database. Since the client sending the shutdown request doesn't have its socket closed explicitly by the server, we can just read from the socket in the client to create a delay until the actual exit, which can take a while if there's an in-memory DB. Signed-off-by: Seebs <seebs@seebs.net>