aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* * process.c (read_process_output): Use p instead of XPROCESS (proc).Andreas Schwab2012-01-211-6/+4
| | | | (send_process): Likewise.
* Add 2012 to FSF copyright years for Emacs filesGlenn Morris2012-01-051-1/+1
|
* Spelling fixes.Paul Eggert2011-12-291-1/+1
|
* * src/process.c (start_process_unwind): Treat any pid <= 0, except -2,Glenn Morris2011-12-061-2/+3
| | | | | | | as an error, not just -1. For example, make_process inits the pid to 0. Fixes: debbugs:10217
* Remove GCPRO-related macros that exist only to avoid shadowing locals.Paul Eggert2011-11-281-5/+5
| | | | | | | | | * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR) (GCPRO6_VAR, UNGCPRO_VAR): Remove. See <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>. All uses changed to use GCPRO1 etc. (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO): Revert to old implementation (i.e., before 2011-03-11).
* Rename locals to avoid shadowing.Paul Eggert2011-11-251-14/+17
| | | | | | | | * fileio.c (Finsert_file_contents): Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing. * process.c (wait_reading_process_output): Rename inner 'proc' to 'p' to avoid shadowing. Indent for consistency with usual Emacs style.
* Spelling fixes.Paul Eggert2011-11-241-1/+1
|
* (wait_reading_process_output): Add comment and URL.Lars Magne Ingebrigtsen2011-11-211-1/+5
|
* Fix asynchrounous GnuTLS socket handling on some versions of the GnuTLS library.Lars Magne Ingebrigtsen2011-11-211-9/+33
| | | | | | Some versions of the GnuTLS library doesn't respons to poll reliably. Work around this by checking all GnuTLS sockets explicitly from the idle loop.
* Spelling fixes.Paul Eggert2011-11-191-1/+1
|
* Spelling fixes.Paul Eggert2011-11-171-1/+1
|
* Spelling fixes.Paul Eggert2011-11-141-2/+2
|
* Set members of the struct coding_system before accessing them ↵Kenichi Handa2011-11-071-0/+1
| | | | (bug#9910,9911,9912).
* Revert problematic change to wait_reading_process_output.Glenn Morris2011-10-281-9/+4
| | | | | * src/process.c (wait_reading_process_output): Revert 2009-08-30 change. Not clear what it was for, and it causes various bugs. (Bug#9839)
* More gnutls memory fixes.Chong Yidong2011-10-271-0/+1
| | | | | | | | | | | * src/gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is non-NULL, regardless of GNUTLS_INITSTAGE. (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal an error. Set process slots as soon as we allocate them. * src/gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros. * src/process.c (make_process): Set gnutls_state to NULL.
* Fix a memory leak in the built-in GnuTLS support.Chong Yidong2011-10-271-0/+7
| | | | | | | | | * src/gnutls.c (emacs_gnutls_deinit): New function. Deallocate credentials structures as well as calling gnutls_deinit. (Fgnutls_deinit, Fgnutls_boot): Use it. * src/process.c (make_process): Initialize GnuTLS credentials to NULL. (deactivate_process): Call emacs_gnutls_deinit.
* Whitespace changes.Juanma Barranquero2011-09-091-20/+20
|
* * process.c (make_process): Use printmax_t, not int, to formatPaul Eggert2011-08-291-3/+3
| | | | process-name gensyms.
* Merge from trunk.Paul Eggert2011-08-241-0/+3
|\
| * * lisp/mpc.el (mpc--proc-filter): Don't signal mpc-proc-error since signalsStefan Monnier2011-08-231-0/+3
| | | | | | | | | | | | | | | | | | from process filters aren't reliably transmitted to the surrounding accept-process-output. (mpc-proc-check): New function. (mpc-proc-sync): Use it Fixes: debbugs:8293
* | Merge from trunk.Paul Eggert2011-08-181-19/+17
|\ \ | |/
| * * src/process.c (Fnetwork_interface_list): Correctly determine bufferAndreas Schwab2011-08-181-22/+41
| | | | | | | | size.
* | Merge from trunk.Paul Eggert2011-08-141-1/+4
|\ \ | |/
| * Avoid crash with invalid default-process-coding-system.Kenichi Handa2011-08-141-1/+4
| | | | | | | | | | * src/process.c (create_process): Call setup_process_coding_systems after the pid of the process is set to -1.
| |
| \
*-. \ Merge from trunk.Paul Eggert2011-08-131-10/+83
|\ \ \ | | |/
| | * * process.c (Fnetwork_interface_info): Declare local only if needed.Paul Eggert2011-08-131-1/+2
| | |
| | * Fix network-interface-list|info on newer BSD derived OS:es.Jan Djärv2011-08-131-12/+82
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.in: Add header check: sys/socket.h, ifaddrs.h, net/if_dl.h. Check for getifaddrs and freeifaddrs. Check for sa_len in struct ifreq.ifr_addr (Bug#8477). * src/process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477). (Fnetwork_interface_list): Allocate in increments of bytes instead of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct sockaddr. (struct ifflag_def): notrailers is smart on OSX. (Fnetwork_interface_info): Handle case when ifr_flags is negative. Get hardware address with getifaddrs if available.
* | Adjust in response to jan.h.d's comments.Paul Eggert2011-08-041-15/+3
| | | | | | | | See, for example <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#26>.
* | * process.c (Fnetwork_interface_list): Check for overflowPaul Eggert2011-07-281-0/+6
|/ | | | in size calculation.
* Use the same condition for POLL_FOR_INPUT in both keyboard.c and process.cLars Magne Ingebrigtsen2011-07-161-1/+1
| | | | Fixes: debbugs:1858
* Use pthread_sigmask, not sigprocmask.Paul Eggert2011-07-061-3/+3
| | | | | | | | * callproc.c (Fcall_process): * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask): * process.c (create_process): sigprocmask is portable only for single-threaded applications, and Emacs can be multi-threaded when it uses GTK.
* * process.c: Add defined (HAVE_GSETTINGS) for xgselect.hJan Djärv2011-07-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for xg_select. * xgselect.c: Add defined (HAVE_GSETTINGS). (xgselect_initialize): Ditto. * xsettings.c (store_monospaced_changed): Take new font as arg and check for change against current_mono_font. (EMACS_TYPE_SETTINGS): Remove this and related defines. (emacs_settings_constructor, emacs_settings_get_property) (emacs_settings_set_property, emacs_settings_class_init) (emacs_settings_init, gsettings_obj): Remove. (something_changedCB): New function for HAVE_GSETTINGS. (something_changedCB): HAVE_GCONF: Call store_monospaced_changed with value as argument. (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling g_settings_new. Do not create gsettings_obj. Remove calls to g_settings_bind. Connect something_changedCB to "changed". Fixes: debbugs:8967
* Fix handling of pending signals in wait_reading_process_output (Bug#8869).Chong Yidong2011-06-251-3/+9
| | | | | | * process.c (wait_reading_process_output): Bypass select if waiting for a cell while ignoring keyboard input, and input is pending. Suggested by Jan Djärv.
* Move DEFSYM to lisp.h and use everywhere.Juanma Barranquero2011-06-241-160/+83
|
* Merge from trunk.Paul Eggert2011-06-201-1/+2
|\
| * * src/process.c (Fset_process_buffer): Clarify return value in docstring.Deniz Dogan2011-06-201-1/+2
| |
* | * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.Paul Eggert2011-06-191-1/+1
|/ | | | We prefer signed integers, even for size calculations.
* Variadic C functions now count arguments with ptrdiff_t.Paul Eggert2011-06-141-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | This partly undoes my 2011-03-30 change, which replaced int with size_t. Back then I didn't know that the Emacs coding style prefers signed int. Also, in the meantime I found a few more instances where arguments were being counted with int, which may truncate counts on 64-bit machines, or EMACS_INT, which may be unnecessarily wide. * lisp.h (struct Lisp_Subr.function.aMANY) (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Arg counts are now ptrdiff_t, not size_t. All variadic functions and their callers changed accordingly. (struct gcpro.nvars): Now size_t, not size_t. All uses changed. * bytecode.c (exec_byte_code): Check maxdepth for overflow, to avoid potential buffer overrun. Don't assume arg counts fit in 'int'. * callint.c (Fcall_interactively): Check arg count for overflow, to avoid potential buffer overrun. Use signed char, not 'int', for 'varies' array, so that we needn't bother to check its size calculation for overflow. * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args. * eval.c (apply_lambda): * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length. (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed. (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
* * buffer.c (Qclone_number): Remove for now, as it's unused.Paul Eggert2011-06-111-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (record_buffer, Funrecord_buffer): Rename local to avoid shadowing. (record_buffer): Remove unused local. * frame.c (other_visible_frames, frame_buffer_list): Now static. (set_frame_buffer_list): Remove; unused. * frame.h (other_visible_frames): Remove decl. * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF. * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls. (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only if HAVE_GPM. * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF. * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Define only if HAVE_GPM. * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static. (update_hints_inhibit): Remove; never set. All uses removed. * widgetprv.h (emacsFrameClassRec): Remove decl. * window.c (delete_deletable_window): Now returns void, since it wasn't returning anything. (compare_window_configurations): Remove unused locals. * xfns.c (x_set_scroll_bar_default_width): Remove unused locals. * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF. Omit no-longer-needed #ifdef USE_X_TOOLKIT, since USE_X_TOOLKIT is implied by USE_GTK || USE_MOTIF. (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers the same widths as pointers. This follows up on the 2011-05-06 patch. * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID. * xterm.h: Likewise. (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
* [ChangeLog]Paul Eggert2011-05-281-1/+1
| | | | | | | | | | | | | | | | | | | | Use 'inline', not 'INLINE'. * configure.in, autogen/config.in (INLINE): Remove. [lib-src/ChangeLog] Use 'inline', not 'INLINE'. * etags.c (hash): Now inline unconditionally. * make-docfile.c (put_char): inline, not INLINE. [nt/ChangeLog] Use 'inline', not 'INLINE'. * config.nt (INLINE): Remove. [src/ChangeLog] Use 'inline', not 'INLINE'. * alloc.c, fontset.c (INLINE): Remove. * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c: * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c: * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline. * gmalloc.c (register_heapinfo): Use inline unconditionally. * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
* Merge from mainline.Paul Eggert2011-05-041-6/+6
|\
| * src/gnutls.c: Remove unused parameter `fildes'.Juanma Barranquero2011-05-051-4/+3
| | | | | | | | | | | | | | * gnutls.h (emacs_gnutls_write, emacs_gnutls_read): * gnutls.c (emacs_gnutls_write, emacs_gnutls_read): Remove unused parameter `fildes'. * process.c (read_process_output, send_process): Don't pass it.
| * Implement dynamic loading of GnuTLS on Windows.Juanma Barranquero2011-05-041-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/term/w32-win.el (dynamic-library-alist): Add `gnutls'. * nt/INSTALL: Clarify GnuTLS support. * src/callproc.c, src/emacs.c: Include lisp.h before src/w32.h, not after. * src/gnutls.c (Qgnutls_dll): Define. (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros. (gnutls_*): Declare function pointers. (init_gnutls_functions): New function to initialize function pointers. (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit) (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers. (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno): Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno. (emacs_gnutls_write, emacs_gnutls_read) (emacs_gnutls_handle_error, Fgnutls_error_fatalp) (Fgnutls_available_p): New function. (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers. (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it. (syms_of_gnutls) <Sgnutls_available_p>: defsubr it. * src/gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro. (emacs_gnutls_write, emacs_gnutls_read): Mark as extern. (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno): Declare. * src/w32.c (QCloaded_from, Vlibrary_cache): Define. (w32_delayed_load): Move from image.c. When loading a library, record its filename in the :loaded-from property of the library id. (globals_of_w32) <QCloaded_from, Vlibrary_cache>: Initialize and staticpro them. (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions. * src/image.c: Include w32.h. (Vimage_type_cache): Delete. (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it. (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead. (w32_delayed_load): Move to w32.c. * src/process.c: Include lisp.h before src/w32.h, not after. (wait_reading_process_output): Call emacs_gnutls_record_check_pending instead of gnutls_record_check_pending. * src/w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
| * Don't test HAVE_INTTYPES_H in process.c.Eli Zaretskii2011-04-301-2/+0
| | | | | | | | | | | | src/process.c: Remove HAVE_INTTYPES_H condition from inclusion of inttypes.h, as a gnulib replacement is used if it not available in system headers.
* | * process.c (Fformat_network_address): Fix typo: args2 -> *args2.Paul Eggert2011-05-021-1/+1
| |
* | * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.Paul Eggert2011-04-291-4/+1
|/
* Merge from mainline.Paul Eggert2011-04-251-0/+16
|\
| * Add GnuTLS support for W32 and certificate and hostname verification in GnuTLS.Ted Zlatanov2011-04-241-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/gnutls.c: Renamed global_initialized to gnutls_global_initialized. Added internals for the :verify-hostname-error, :verify-error, and :verify-flags parameters of `gnutls-boot' and documented those parameters in the docstring. Start callback support. (emacs_gnutls_handshake): Add Woe32 support. Retry handshake unless a fatal error occured. Call gnutls_alert_send_appropriate on error. Return error code. (emacs_gnutls_write): Call emacs_gnutls_handle_error. (emacs_gnutls_read): Likewise. (Fgnutls_boot): Return handshake error code. (emacs_gnutls_handle_error): New function. (wsaerror_to_errno): Likewise. * src/gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the callbacks stage. * src/w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32. (emacs_gnutls_push): Likewise. * src/w32.h (emacs_gnutls_pull): Add prototype. (emacs_gnutls_push): Likewise.
* | lisp.h: Fix a problem with aliasing and vector headers.Paul Eggert2011-04-251-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC 4.6.0 optimizes based on type-based alias analysis. For example, if b is of type struct buffer * and v of type struct Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size != &v->size, and therefore "v->size = 1; b->size = 2; return v->size;" must therefore return 1. This assumption is incorrect for Emacs, since it type-puns struct Lisp_Vector * with many other types. To fix this problem, this patch adds a new type struct vector_header that documents the constraints on layout of vectors and pseudovectors, and helps optimizing compilers not get fooled by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons. * lisp.h (XVECTOR_SIZE): New convenience macro. All previous uses of XVECTOR (foo)->size replaced to use this macro, to avoid the hassle of writing XVECTOR (foo)->header.size. (XVECTOR_HEADER_SIZE): New macro, for use in XSETPSEUDOVECTOR. (XSETTYPED_PVECTYPE): New macro, specifying the name of the size member. (XSETPVECTYPE): Rewrite in terms of new macro. (XSETPVECTYPESIZE): New macro, specifying both type and size. This is a bit clearer, and further avoids the possibility of undesirable aliasing. (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size. (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XVECTOR_HEADER_SIZE. (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE, since Lisp_Subr is a special case (no "next" field). (ASIZE): Rewrite in terms of XVECTOR_SIZE. (struct vector_header): New type. (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the object, to help avoid aliasing. (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP. (SUBRP): Likewise, since Lisp_Subr is a special case. * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table): (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector): (struct Lisp_Hash_Table): Combine first two members into a single struct vector_header member. All uses of "size" and "next" members changed to be "header.size" and "header.next". * buffer.h (struct buffer): Likewise. * font.h (struct font_spec, struct font_entity, struct font): Likewise. * frame.h (struct frame): Likewise. * process.h (struct Lisp_Process): Likewise. * termhooks.h (struct terminal): Likewise. * window.c (struct save_window_data, struct saved_window): Likewise. * window.h (struct window): Likewise. * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector): Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems. * buffer.c (init_buffer_once): Likewise. * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a special case. * process.c (Fformat_network_address): Use local var for size, for brevity.
* | * process.c (Fnetwork_interface_info): Avoid left-shift undefinedPaul Eggert2011-04-181-2/+2
| | | | | | | | behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.