Overview
Comment: | Moved option parsing to a separate function and added help, set default directory time to start time |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
7324be78caf6356e2131ac0fbdf154b8 |
User & Date: | rkeene on 2014-11-18 01:06:59 |
Other Links: | manifest | tags |
Context
2014-11-18
| ||
01:13 | Prettied up Makefile check-in: 48dd71800a user: rkeene tags: trunk | |
01:06 | Moved option parsing to a separate function and added help, set default directory time to start time check-in: 7324be78ca user: rkeene tags: trunk | |
00:06 | Added comment a distclean target for archive check-in: 1beb5adeec user: rkeene tags: trunk | |
Changes
Modified appfsd.c from [276d2f6247] to [dafdf12fdd].
︙ | |||
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | + - | /* * Global variables, needed for all threads but only initialized before any * FUSE threads are created */ const char *appfs_cachedir; time_t appfs_boottime; int appfs_fuse_started = 0; int appfs_threaded_tcl; /* * Global variables for AppFS caching */ pthread_mutex_t appfs_path_info_cache_mutex = PTHREAD_MUTEX_INITIALIZER; int appfs_path_info_cache_size = 8209; struct appfs_pathinfo *appfs_path_info_cache = NULL; #ifndef TCL_THREADS /* * Handle unthreaded Tcl */ pthread_mutex_t appfs_tcl_big_global_lock = PTHREAD_MUTEX_INITIALIZER; #define appfs_call_libtcl_enter pthread_mutex_lock(&appfs_tcl_big_global_lock); #define appfs_call_libtcl_exit pthread_mutex_unlock(&appfs_tcl_big_global_lock); #else |
︙ | |||
965 966 967 968 969 970 971 | 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 | - + | Tcl_DictObjGet(interp, attrs_dict, attr_key_time, &attr_value); if (attr_value != NULL) { tcl_ret = Tcl_GetWideIntFromObj(NULL, attr_value, &attr_value_wide); if (tcl_ret == TCL_OK) { pathinfo->time = attr_value_wide; } } else { |
︙ | |||
1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 | 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 | + | * Hot-restart support */ /* Initiate a hot-restart */ static void appfs_hot_restart(void) { APPFS_DEBUG("Asked to initiate hot restart"); appfs_tcl_ResetInterps(); appfs_get_path_info_cache_flush(-1, -1); return; } /* * Signal handler |
︙ | |||
1911 1912 1913 1914 1915 1916 1917 | 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 | + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | APPFS_DEBUG("Terminating interpreter due to thread termination"); appfs_call_libtcl( Tcl_DeleteInterp(interp); ) appfs_call_libtcl( |
︙ | |||
1937 1938 1939 1940 1941 1942 1943 | 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 | - - - - - - - - - - - - - - - - - - - + + + + + + | .unlink = appfs_fuse_unlink_rmdir, .rmdir = appfs_fuse_unlink_rmdir, .mkdir = appfs_fuse_mkdir, .chmod = appfs_fuse_chmod, .symlink = appfs_fuse_symlink, }; |
︙ | |||
2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 | 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - | /* * Tcl mode, for running raw Tcl in the same environment AppFSd would * run code. */ if (argc == 2 && strcmp(argv[0], "--tcl") == 0) { return(appfs_tcl(argv[1])); } /* * Register a signal handler for hot-restart requests */ signal_ret = signal(SIGHUP, appfs_signal_handler); if (signal_ret == SIG_ERR) { fprintf(stderr, "Unable to install signal handler for hot-restart\n"); fprintf(stderr, "Hot-restart will not be available.\n"); } /* * Parse command line arguments */ /** ** Restore argc/argv to original values, replacing argv[0] in case ** it was moified by --cachedir option. **/ argc++; argv--; argv[0] = argv0; /** ** Perform the argument parsing **/ aop_ret = appfs_opt_parse(argc, argv, &args); if (aop_ret != 0) { return(aop_ret); } /* * Create a Tcl interpreter just to verify that things are in working * order before we become a daemon. */ test_interp = appfs_create_TclInterp(&test_interp_error); if (test_interp == NULL) { if (test_interp_error == NULL) { test_interp_error = "Unknown error"; } fprintf(stderr, "Unable to initialize Tcl interpreter for AppFSd:\n"); fprintf(stderr, "%s\n", test_interp_error); return(1); } Tcl_DeleteInterp(test_interp); if (appfs_threaded_tcl) { |