aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/src/Modules/fcntlmodule.c
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.ru>2022-02-10 16:44:30 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:44:30 +0300
commit2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch)
tree012bb94d777798f1f56ac1cec429509766d05181 /contrib/tools/python3/src/Modules/fcntlmodule.c
parent6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff)
downloadydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/tools/python3/src/Modules/fcntlmodule.c')
-rw-r--r--contrib/tools/python3/src/Modules/fcntlmodule.c86
1 files changed, 43 insertions, 43 deletions
diff --git a/contrib/tools/python3/src/Modules/fcntlmodule.c b/contrib/tools/python3/src/Modules/fcntlmodule.c
index 43f9b22f67..de92c04655 100644
--- a/contrib/tools/python3/src/Modules/fcntlmodule.c
+++ b/contrib/tools/python3/src/Modules/fcntlmodule.c
@@ -66,10 +66,10 @@ fcntl_fcntl_impl(PyObject *module, int fd, int code, PyObject *arg)
char buf[1024];
int async_err = 0;
- if (PySys_Audit("fcntl.fcntl", "iiO", fd, code, arg ? arg : Py_None) < 0) {
- return NULL;
- }
-
+ if (PySys_Audit("fcntl.fcntl", "iiO", fd, code, arg ? arg : Py_None) < 0) {
+ return NULL;
+ }
+
if (arg != NULL) {
int parse_result;
@@ -175,11 +175,11 @@ fcntl_ioctl_impl(PyObject *module, int fd, unsigned int code,
Py_ssize_t len;
char buf[IOCTL_BUFSZ+1]; /* argument plus NUL byte */
- if (PySys_Audit("fcntl.ioctl", "iIO", fd, code,
- ob_arg ? ob_arg : Py_None) < 0) {
- return NULL;
- }
-
+ if (PySys_Audit("fcntl.ioctl", "iIO", fd, code,
+ ob_arg ? ob_arg : Py_None) < 0) {
+ return NULL;
+ }
+
if (ob_arg != NULL) {
if (PyArg_Parse(ob_arg, "w*:ioctl", &pstr)) {
char *arg;
@@ -297,10 +297,10 @@ fcntl_flock_impl(PyObject *module, int fd, int code)
int ret;
int async_err = 0;
- if (PySys_Audit("fcntl.flock", "ii", fd, code) < 0) {
- return NULL;
- }
-
+ if (PySys_Audit("fcntl.flock", "ii", fd, code) < 0) {
+ return NULL;
+ }
+
#ifdef HAVE_FLOCK
do {
Py_BEGIN_ALLOW_THREADS
@@ -385,11 +385,11 @@ fcntl_lockf_impl(PyObject *module, int fd, int code, PyObject *lenobj,
int ret;
int async_err = 0;
- if (PySys_Audit("fcntl.lockf", "iiOOi", fd, code, lenobj ? lenobj : Py_None,
- startobj ? startobj : Py_None, whence) < 0) {
- return NULL;
- }
-
+ if (PySys_Audit("fcntl.lockf", "iiOOi", fd, code, lenobj ? lenobj : Py_None,
+ startobj ? startobj : Py_None, whence) < 0) {
+ return NULL;
+ }
+
#ifndef LOCK_SH
#define LOCK_SH 1 /* shared lock */
#define LOCK_EX 2 /* exclusive lock */
@@ -457,7 +457,7 @@ static PyMethodDef fcntl_methods[] = {
PyDoc_STRVAR(module_doc,
-"This module performs file control and I/O control on file\n\
+"This module performs file control and I/O control on file\n\
descriptors. It is an interface to the fcntl() and ioctl() Unix\n\
routines. File descriptors can be obtained with the fileno() method of\n\
a file or socket object.");
@@ -513,24 +513,24 @@ all_ins(PyObject* m)
#ifdef F_SETLKW
if (PyModule_AddIntMacro(m, F_SETLKW)) return -1;
#endif
-#ifdef F_OFD_GETLK
- if (PyModule_AddIntMacro(m, F_OFD_GETLK)) return -1;
-#endif
-#ifdef F_OFD_SETLK
- if (PyModule_AddIntMacro(m, F_OFD_SETLK)) return -1;
-#endif
-#ifdef F_OFD_SETLKW
- if (PyModule_AddIntMacro(m, F_OFD_SETLKW)) return -1;
-#endif
+#ifdef F_OFD_GETLK
+ if (PyModule_AddIntMacro(m, F_OFD_GETLK)) return -1;
+#endif
+#ifdef F_OFD_SETLK
+ if (PyModule_AddIntMacro(m, F_OFD_SETLK)) return -1;
+#endif
+#ifdef F_OFD_SETLKW
+ if (PyModule_AddIntMacro(m, F_OFD_SETLKW)) return -1;
+#endif
#ifdef F_GETOWN
if (PyModule_AddIntMacro(m, F_GETOWN)) return -1;
#endif
#ifdef F_SETOWN
if (PyModule_AddIntMacro(m, F_SETOWN)) return -1;
#endif
-#ifdef F_GETPATH
- if (PyModule_AddIntMacro(m, F_GETPATH)) return -1;
-#endif
+#ifdef F_GETPATH
+ if (PyModule_AddIntMacro(m, F_GETPATH)) return -1;
+#endif
#ifdef F_GETSIG
if (PyModule_AddIntMacro(m, F_GETSIG)) return -1;
#endif
@@ -650,15 +650,15 @@ all_ins(PyObject* m)
if (PyModule_AddIntMacro(m, I_PLINK)) return -1;
if (PyModule_AddIntMacro(m, I_PUNLINK)) return -1;
#endif
-#ifdef F_ADD_SEALS
- /* Linux: file sealing for memfd_create() */
- if (PyModule_AddIntMacro(m, F_ADD_SEALS)) return -1;
- if (PyModule_AddIntMacro(m, F_GET_SEALS)) return -1;
- if (PyModule_AddIntMacro(m, F_SEAL_SEAL)) return -1;
- if (PyModule_AddIntMacro(m, F_SEAL_SHRINK)) return -1;
- if (PyModule_AddIntMacro(m, F_SEAL_GROW)) return -1;
- if (PyModule_AddIntMacro(m, F_SEAL_WRITE)) return -1;
-#endif
+#ifdef F_ADD_SEALS
+ /* Linux: file sealing for memfd_create() */
+ if (PyModule_AddIntMacro(m, F_ADD_SEALS)) return -1;
+ if (PyModule_AddIntMacro(m, F_GET_SEALS)) return -1;
+ if (PyModule_AddIntMacro(m, F_SEAL_SEAL)) return -1;
+ if (PyModule_AddIntMacro(m, F_SEAL_SHRINK)) return -1;
+ if (PyModule_AddIntMacro(m, F_SEAL_GROW)) return -1;
+ if (PyModule_AddIntMacro(m, F_SEAL_WRITE)) return -1;
+#endif
return 0;
}
@@ -686,10 +686,10 @@ PyInit_fcntl(void)
return NULL;
/* Add some symbolic constants to the module */
- if (all_ins(m) < 0) {
- Py_DECREF(m);
+ if (all_ins(m) < 0) {
+ Py_DECREF(m);
return NULL;
- }
+ }
return m;
}