Geometrical effects on linear stability of electrostatic resistive edge modes are investigated in the three-dimensional Wendelstein 7-X stellarator [G. Grieger et al., Plasma Physics and Controlled Nuclear Fusion Research 1990 (International Atomic Energy Agency, Vienna, 1991), Vol. 3, p. 525] and the International Thermonuclear Experimental Reactor [Progress in the ITER Physics Basis, Nucl. Fusion 7, S1, S285 (2007)]-like equilibria. An advanced fluid model is used for the ions together with the reduced Braghinskii equations for the electrons. Using the ballooning mode representation, the drift wave problem is set as an eigenvalue equation along a field line and is solved numerically using a standard shooting technique. A significantly larger magnetic shear and a less unfavorable normal curvature in the tokamak equilibrium are found to give a stronger finite-Larmor radius stabilization and a more narrow mode spectrum than in the stellarator. The effect of negative global magnetic shear in the tokamak is found to be stabilizing. The growth rate on a tokamak magnetic flux surface is found to be comparable to that on a stellarator surface with the same global magnetic shear but the eigenfunction in the tokamak is broader than in the stellarator due to the presence of large negative local magnetic shear (LMS) on the tokamak surface. A large absolute value of the LMS in a region of unfavorable normal curvature is found to be stabilizing in the stellarator, while in the tokamak case, negative LMS is found to be stabilizing and positive LMS destabilizing.