X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=libs%2Flmo%2Fsrc%2Flmo_core.c;h=08141383e3dcd04f3f3d00554a0dc485212ecea1;hp=6a9623aa9f6187e7b4f62f6ba426426de7b1b0ca;hb=f383dc0229138d7b9fce3280730c66d6f7c1b8f5;hpb=9dcf1d9e603ecf66fc67f3f110168a3e0a4f57fa diff --git a/libs/lmo/src/lmo_core.c b/libs/lmo/src/lmo_core.c index 6a9623aa9..08141383e 100644 --- a/libs/lmo/src/lmo_core.c +++ b/libs/lmo/src/lmo_core.c @@ -1,7 +1,7 @@ /* * lmo - Lua Machine Objects - Base functions * - * Copyright (C) 2009 Jo-Philipp Wich + * Copyright (C) 2009-2010 Jo-Philipp Wich * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -94,6 +94,8 @@ lmo_archive_t * lmo_open(const char *file) ar->fd = in; ar->length = idx_offset; + fcntl(ar->fd, F_SETFD, fcntl(ar->fd, F_GETFD) | FD_CLOEXEC); + for( i = idx_offset; i < (s.st_size - sizeof(uint32_t)); i += (4 * sizeof(uint32_t)) @@ -230,4 +232,3 @@ int lmo_lookup(lmo_archive_t *ar, const char *key, char *dest, int len) return copy_len; } -