/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to dracut-module/password-agent.c

  • Committer: Teddy Hogeborn
  • Date: 2019-08-10 15:19:47 UTC
  • Revision ID: teddy@recompile.se-20190810151947-wyw7cetrh1pvtw37
Simplification of Python 3 compatibility code

Normally, "class Foo:" in Python 2 creates a "classic" class, but in
Python 3, all classes are "new-style" classes, which you can get in
Python 2 by doing "class Foo(object):", i.e. inheriting from "object".
But, you can also get a new-style classes from "class Foo:" in Python
2 by setting the global "__metaclass__" variable to "type", which
makes the code less cluttered.  Note: it is still necessary to inherit
from "object" in Python 2 to get a new-style class if the class is
otherwise inheriting only from "classic" classes.

* mandos: Set "__metaclass__ = type" globally for Python 2, and remove
          inheriting from "object" in all places possible.
* mandos-ctl: - '' -

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
#include <error.h>              /* error() */
49
49
#include <sysexits.h>           /* EX_USAGE, EX_OSERR, EX_OSFILE */
50
50
#include <errno.h>              /* errno, error_t, EACCES,
51
 
                                   ENAMETOOLONG, ENOENT, EEXIST,
52
 
                                   ECHILD, EPERM, ENOMEM, EAGAIN,
53
 
                                   EINTR, ENOBUFS, EADDRINUSE,
 
51
                                   ENAMETOOLONG, ENOENT, ENOTDIR,
 
52
                                   EEXIST, ECHILD, EPERM, ENOMEM,
 
53
                                   EAGAIN, EINTR, ENOBUFS, EADDRINUSE,
54
54
                                   ECONNREFUSED, ECONNRESET,
55
55
                                   ETOOMANYREFS, EMSGSIZE, EBADF,
56
56
                                   EINVAL */
84
84
#include <fcntl.h>              /* O_CLOEXEC, O_NONBLOCK, fcntl(),
85
85
                                   F_GETFD, F_GETFL, FD_CLOEXEC,
86
86
                                   open(), O_WRONLY, O_NOCTTY,
87
 
                                   O_RDONLY */
 
87
                                   O_RDONLY, O_NOFOLLOW */
88
88
#include <sys/wait.h>           /* waitpid(), WNOHANG, WIFEXITED(),
89
89
                                   WEXITSTATUS() */
90
90
#include <limits.h>             /* PIPE_BUF, NAME_MAX, INT_MAX */
91
91
#include <sys/inotify.h>        /* inotify_init1(), IN_NONBLOCK,
92
92
                                   IN_CLOEXEC, inotify_add_watch(),
93
93
                                   IN_CLOSE_WRITE, IN_MOVED_TO,
94
 
                                   IN_DELETE, struct inotify_event */
 
94
                                   IN_MOVED_FROM, IN_DELETE,
 
95
                                   IN_EXCL_UNLINK, IN_ONLYDIR,
 
96
                                   struct inotify_event */
95
97
#include <fnmatch.h>            /* fnmatch(), FNM_FILE_NAME */
96
98
#include <stdio.h>              /* asprintf(), FILE, fopen(),
97
99
                                   getline(), sscanf(), feof(),